This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Debugging GDB and breaking?
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: gdb at sources dot redhat dot com, i_am_triumph at ofir dot dk
- Date: Wed, 18 Dec 2002 09:23:30 -0600
- Subject: Re: Debugging GDB and breaking?
Some general hints for debugging gdb:
I start with "gdb /my/gdb/to/debug/bin/gdb". I like to use a stable gdb
for the top gdb, such as the vendor-supplied gdb or gdb 5.3. Also this
helps separate, in my mind, the top gdb from the inferior gdb.
Then I immediately:
(gdb) set prompt [top]
[top] break help_command
[top] set args /program/under/test
The first line distinguishes the top gdb from the inferior gdb.
The second line lets me get back to the top gdb from the inferior gdb.
If the inferior gdb is waiting at a prompt, I just type "help foo"
and take the breakpoint at help_command.
The third line is the normal way to provide arguments to the inferior gdb.
After that, in your specific case, you want to break at break_command
and then use "next" and "step" from there.
Hope this helps,
Michael C