This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v4 0/2] multi-executable support


[Apologies if you receive this twice.  It appears the
patch still overflows the email size limits at sourceware.org, so
I'm re-splitting it in two, and posting the pieces as replies
to this email.]

Here's an updated patch to add multi-executable support to GDB.

Let me re-introduce this: Currently, GDB's multi-inferior support
can only debug multiple processes that run the same
program (e.g., several forks of the same program).  With this patch,
GDB gains the ability to debug multiple different programs within
the same session.  For example, when staying attached to both
child and parent of a fork, and the child then does an exec, GDB
gets very confused with the parent, since the symbols it has loaded
only make sense for the child --- the parent is still running
the same pre-child-exec image.  Similar confusion happens currently
if one of the forks loads a shared library while the other doesn't,
as GDB maintains a single shared library list for all the forks.
This patch addresses these issues.

Many pieces and dependencies of this work have gone in since I
started posting this months ago, so this is now reduced to a
single patch (but split in two due to email size restrictions).

Compared to the previous patch set

 http://sourceware.org/ml/gdb-patches/2009-07/msg00134.html
 http://sourceware.org/ml/gdb-patches/2009-07/msg00135.html
 http://sourceware.org/ml/gdb-patches/2009-07/msg00136.html

and previous-previously at (with more description and examples):

 http://sourceware.org/ml/gdb-patches/2009-06/msg00388.html

this fixes the crashes Tom reported (follow-fork+non-stop related), and
adjusts both new Paul's objfiles sections map and Ulrich's executing_startup
to be per-symbol space.  While doing so, I found out that creating
the initial symbol-space (there's always one) needs to be done in a
special place to avoid _initialize_foo ordering issues (due to per-sspace
data, we have to give a chance of all modules installing their own sspace
key before creating any symbol space).

I've also extended the docs with a number of
examples and cross links, and added NEWS entries for the new commands,
and mentioning multi-program debugging support.

Tested on native and gdbserver x86_64-unknown-linux-gnu without
regressions, built with --enable-targets=all.

The usual "bootstrap gdb" example is:

cd build/gdb/
./gdb -ex "set non-stop 1" -ex "set target-async 1" -ex "set pagination off" -ex "set detach off" /usr/bin/make
(gdb) r&

Comments most welcome.  Eli, could you please take a look at
the manual, help and NEWS changes?

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]