[gdb 6.7.1/6.8] does '-var-create - @' work or not?

Bogdan Slusarczyk bodzio131@op.pl
Thu Apr 3 13:20:00 GMT 2008


I've done simple test:

int test2( int a )
{
	int b = a + 20;
	return b;//should be a=11, b=31, but is a=31,b=0
}

int test1( int a )
{
	int b = a + 10;
	return test2( b );//should be a=1, b=11, but is a=11, b=11
}

int main( int argc, char** argv )
{
	int a = 10;
	int b = 1;
	test1( 1 );//should be a=10, b=1 and is a=10, b=1

	return 0;
}

I thought that created var objects using '-var-create - @' can be 
updated in another frame. But it doesn't work, -var-evaluate-expression 
returns wrong value. On the other hand 'print' returns right values. Or 
maybe I did something wrong? My sequence: -var-create at the begining, 
and next -var-update and -var-evaluate-expression in another frames.

Regards,
Bogdan



More information about the Gdb mailing list