This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Still problems with gdb and nested functions.
- From: Paul Hilfinger <hilfingr at EECS dot Berkeley dot EDU>
- To: tj <999alfred at comcast dot net>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 22 Feb 2005 12:15:11 -0800
- Subject: Re: Still problems with gdb and nested functions.
> #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