Towards multiprocess GDB

David Daney ddaney@avtrex.com
Fri Jul 18 22:20:00 GMT 2008


Mark Kettenis wrote:
>> Date: Fri, 18 Jul 2008 13:40:08 -0700
>> From: Stan Shebs <stanshebs@earthlink.net>
>>
>> CodeSourcery has a project to add "multiprocess" capability to GDB,
>> and with this message I'd like to kick off some discussion of what
>> that means and how to make it happen.
> 
> Please remind me, why was this a desirable capability again?
> 
> Personally, I can't imagine someone would really want to do this using
> the traditional gdb CLI, at least not within a single gdb instance.
> I'd simply fire up two (or more) xterms and debug the processes
> seperately.  One thing that could be useful though for that scenario
> is the ability to hand of processes between gdb instances upon
> fork/exec.
> 
> I suppose multiprocess debugging makes somewhat more sense in a
> GUI-based IDE environment.  But running multiple instances of gdb
> should work just as well in that case.
> 
> Adding a "multiprocess" capability to GDB is almost certainly going to
> add significant complexity.  So there should be a good motivation for
> it.

Here's my take on it (not being at all involved in the effort):

Suppose that you are debugging both a client and a server process.  One scenario is that you want to debug the results of some command sent between them.

Set a break point in the command handler and disable it.

In the other process set a breakpoint just before sending the command.  This breakpoint's commands could enable the break point in the other process and continue.

Doing this with a multiprocess gdb would be trivial.  If you have to use multiple gdb instances, it is either a manual process or some complicated scripting setup.

Just my $0.02,
David Daney



More information about the Gdb mailing list