tracing variables - is it ok?

Bogdan Slusarczyk bodzio131@op.pl
Fri Jun 1 07:59:00 GMT 2007


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



More information about the Gdb mailing list