This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Still cannot print variable
- From: Joakim Hove <hove at ift dot uib dot no>
- To: fedevaps at yahoo dot dk
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 15 Apr 2005 10:27:08 +0200
- Subject: Re: Still cannot print variable
- References: <d3o02u$t10$1@sea.gmane.org>
JS <fedevaps@yahoo.dk> writes:
> I run "gdb test" followed by "print d" and then I get this error:
You must explicitly start test with the run command from gdb:
bash% gdb test
<...>
(gdb) run
However, that is also not enough because the current program will
immediately complete, and hence when you get back to the (gdb) prompt
the context of the (no longer) running program is void. Hence you must
set a breakpoint to halt the execution:
bash% gdb test
<...>
(gdb) break test.c:5 # Break at line 5 in file test.c
(gdb) run
(gdb) print d
HTH - Joakim
--
Joakim Hove
hove AT ift uib no /
Tlf: +47 (55 5)8 27 90 / Stabburveien 18
Fax: +47 (55 5)8 94 40 / N-5231 Paradis
http://www.ift.uib.no/~hove/ / 55 91 28 18 / 92 68 57 04