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]

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


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