Still problems with gdb and nested functions.

Paul Hilfinger hilfingr@EECS.Berkeley.EDU
Tue Feb 22 20:27:00 GMT 2005


> #include <stdio.h>
> 
> int main(int argc, char *argv[]){
> 
>   int i,j;
> 
>   int inside(void){
>     int k,l;
> 
>     k = 1;
>     l = k;
>     printf("inside, k = %d, l = %d\n", k,l);
>     return 0;
> 
>   }
> 
>   inside();
>   i = 0;
>   j = 1;
> }
> 
....
> Breakpoint 1, inside.0 () at test.c:12
> 12          printf("inside, k = %d, l = %d\n", k,l);
> (gdb) p k
> No symbol "k" in current context.

I presume you have confirmed that k is actually there (since it is set
only from a constant, it could be folded away even without fancy
optimization).

Paul Hilfinger



More information about the Gdb mailing list