From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27557 invoked by alias); 20 Mar 2007 13:59:00 -0000 Received: (qmail 27546 invoked by uid 22791); 20 Mar 2007 13:58:59 -0000 X-Spam-Check-By: sourceware.org Received: from sophia.inria.fr (HELO sophia.inria.fr) (138.96.64.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Mar 2007 13:58:55 +0000 Received: from localhost (localhost [127.0.0.1]) by sophia.inria.fr (8.13.8/8.13.8) with ESMTP id l2KDwnJY028226; Tue, 20 Mar 2007 14:58:49 +0100 Received: from [194.254.174.31] (vis031b.inria.fr [194.254.174.31]) (authenticated bits=0) by sophia.inria.fr (8.13.8/8.13.8) with ESMTP id l2KDwlui028221 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 20 Mar 2007 14:58:47 +0100 Subject: Re: gdb and dynamic loader namespaces From: mathieu lacage To: Daniel Jacobowitz Cc: gdb@sourceware.org In-Reply-To: <20070109134113.GA16313@nevyn.them.org> References: <1168268998.21818.44.camel@garfield.inria.fr> <20070108151510.GA14359@nevyn.them.org> <1168329428.21818.61.camel@garfield.inria.fr> <20070109134113.GA16313@nevyn.them.org> Content-Type: text/plain Date: Tue, 20 Mar 2007 13:59:00 -0000 Message-Id: <1174399155.2558.28.camel@mathieu> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-1.fc6) Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (sophia.inria.fr [138.96.64.20]); Tue, 20 Mar 2007 14:58:47 +0100 (MET) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00230.txt.bz2 [answer to an old email] On Tue, 2007-01-09 at 08:41 -0500, Daniel Jacobowitz wrote: > On Tue, Jan 09, 2007 at 08:57:08AM +0100, Mathieu Lacage wrote: > > The question then is how can we get access to the link_map of each > > namespace from the parent process ? We could perform a lookup for the > > rtld_global data structure and then, use an offset from there to get the > > required data. I suspect you won't be thrilled by that though. Do you > > have any better idea ? Maybe I should ask this question on a glibc ML: I > > would be surprised if no one had ever planned debugger support for this > > feature. > > It may require updating the public members of struct r_debug (and its > version number). I would recommend not digging around in rtld_global, > at least not without talking to the glibc developers first; it's prone > to changing layout between versions. You could see what Solaris does, > if it's in their documentation. It is in their documentation. As far as I can tell, they use the rtld_db API (see chapter 6 of the "Linker and Libraries Guide") to access the underlying data structures. They even provide a version of rtld_db which works on linux except that it has been hardcoded to deal with only the main namespace on linux. Being able to fully implement the library would require intimate access to the glibc data structures. So, I suspect that the implementation challenge would be: - push a rtld_db library in glibc - add rtld_db support to gdb regards, Mathieu