Re: How do you use GDB to debug GDB

Michael Elizabeth Chastain
2001-03-21T15:59:00Z

Hello Stephen,

This is how I do it:

% gdb powerpc-motorola-elf-gdb
(gdb) set prompt [top]
[top] set args --command=C:/rti/bin/rtidbug.ini C:/examples/dll/main.exe
[top] break help_command
[top] run

The first command helps me keep track of which gdb I'm in. There is
a space at the end of the command: "set prompt [top] ".

The second command tells the superior gdb what the arguments are for
the inferior gdb. This is the heart of what you want. Note that you
can re-run the inferior gdb and the arguments will repeat.

The third line sets a convenient breakpoint in the superior gdb so that
you can bounce back up to it. I usually do "help foo" instead of "help"
for getting to the superior gdb, to reduce the screen output.

The fourth line starts the inferior gdb with the arguments given on the
second line.

I've done this on both Unix/Linux and Cygwin gdb's.

Cheers,

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"