From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24163 invoked by alias); 3 Sep 2009 02:49:50 -0000 Received: (qmail 24141 invoked by uid 22791); 3 Sep 2009 02:49:48 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_50,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Sep 2009 02:49:42 +0000 Received: (qmail 24431 invoked from network); 3 Sep 2009 02:49:40 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Sep 2009 02:49:40 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [v4 0/2] multi-executable support Date: Thu, 03 Sep 2009 02:49:00 -0000 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909030349.38319.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00075.txt.bz2 [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