This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]