This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
[RFC] multi-process gdb (forks, checkpoints)
- From: Michael Snyder <msnyder at redhat dot com>
- To: GDB Patches <gdb-patches at sources dot redhat dot com>, gdb at sources dot redhat dot com, drow at false dot org, Eli Zaretskii <eliz at gnu dot org>
- Date: Mon, 28 Nov 2005 14:57:51 -0800
- Subject: [RFC] multi-process gdb (forks, checkpoints)
Folks, I'm pretty close to actually submitting this for approval;
this is (knock on wood) my last request for pre-review.
Instead of attaching a patch, I've checked this in on a branch:
msnyder-fork-checkpoint-branch.
This is, no kidding, gdb debugging multiple processes.
I've adapted it to work with the existing "follow-fork"
infrastructure, so that when a process forks, instead of
being forced to choose between debugging the parent or the
child, we can now debug both. The user sets a mode flag,
and rather than detaching from one of the forks, gdb will
set it aside (in a ptrace-stopped state), and let you
return to debugging it later, switching back and forth
at will.
Daniel, it handles quit, kill, and inferior exit.
If one process exits and there's another available,
it just switches automatically (as it would with threads).
I've added a testcase, gdb.base/multi-forks.exp, which serves
to demonstrate the debugging of 16 forks at a time.
And of course checkpoint and restart are in there too.
Eli, I'll be working on documentation. For the mean time,
the user interface looks like this:
set/show detach-on-fork (on/off) [default on]
info forks
fork <n> [analogous to thread <n>]
detach-fork <n>
delete-fork <n> [and kill]
checkpoint
restart <n>
info checkpoints
delete-checkpoint <n>
detach-checkpoint <n> [well...]