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]

Re: Still cannot print variable


Hello JS,

> 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?

Because you are not yet debugging!
As described above, you started the debugger but not started the
program being debugged.
Try this:
 gdb test
 break main            // to stop your program run
 run
 print d

-- 
Best regards,
 Konstantin 




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