This is the mail archive of the gdb@sources.redhat.com 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]

Still cannot print variable


I am still have problems printing a variable. I have this code in a file
called test.:

int main()
{

        int d = 119;

        return(0);

}

I then compile it like this:

        gcc -g -Wall -o test test.c

(I have also tried with option -O0 but that changes nothing).

I run "gdb test" followed by "print d" and then I get this error:

No symbol "d" in current context.

Why is it not possible to see the contents of "d" when debugging?



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