This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
tracing variables - is it ok?
- From: Bogdan Slusarczyk <bodzio131 at op dot pl>
- To: gdb at sourceware dot org
- Date: Fri, 01 Jun 2007 09:58:37 +0200
- Subject: tracing variables - is it ok?
Hi everybody, suppose such code:
void testB( int a ) { //a == 20
int k = a;
}
void testA( int a ) { //a == 10
int k = a;
testB( 20 );
}
void main() {
testA( 10 );
}
Inside testA I did '-var-create - @ a' and inside testB '-var-update',
but gdb (6.3, 6.6) says that nothing changes and returns a==10 from
testA. Is it intended behaviour? How can I properly trace variable
changes? It applies not only for function arguments - I tryied do the
same thing with 'k', there is the same problem. It strange for me
because '-var-create - @' handles scope changes properly (see below)
{
int a = 10;
{
int a = 20;
}
}
Regards,
Bogdan