Re: Debugging gdb with gdb

Kevin Buettner
2002-02-04T22:02:29Z

On Feb 4, 12:23pm, Piet/Pete Delaney wrote:

> Happen to have a trick to get the inferior GDB to wait for the attaching GDB
> to place breakpoints prior to the inferior setting up a remote debug session.
> skdb starts the inferior gdb with a named pipe (see attached), I'm thinking
> about adding a loop to spin till a global variable is set by the attaching
> gdb to indicate that the inferionr gdb can progress with setting up the
> remote connections and sent the 'g' packet.

I don't understand why you need to do this. Why not just start up the
inferior gdb first and attach to it with another gdb while it's at the
prompt? Once you're attached, you can set breakpoints wherever you
like. After your breakpoints are set, do a ``continue'' and then
start entering your target connection commands in the inferior gdb.
Assuming you've placed a breakpoint somewhere along the execution path
that the inferior gdb will take when/after it connects, you'll be
stopped...

Kevin