This is the mail archive of the
mailing list for the GDB project.
Re: How do you use GDB to debug GDB
- To: gdb at sourceware dot cygnus dot com, ischis2 at home dot com
- Subject: Re: How do you use GDB to debug GDB
- From: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Date: Mon, 19 Mar 2001 12:52:15 -0800
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
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
I've done this on both Unix/Linux and Cygwin gdb's.
Michael Elizabeth Chastain
"love without fear"