From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22875 invoked by alias); 8 Jan 2007 16:45:13 -0000 Received: (qmail 22865 invoked by uid 22791); 8 Jan 2007 16:45:13 -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; Mon, 08 Jan 2007 16:45:03 +0000 Received: from localhost (localhost [127.0.0.1]) by sophia.inria.fr (8.13.8/8.13.4) with ESMTP id l08Giglt029416; Mon, 8 Jan 2007 17:44:42 +0100 Received: from [192.168.1.68] (171.122.69-86.rev.gaoland.net [86.69.122.171] (may be forged)) (authenticated bits=0) by sophia.inria.fr (8.13.8/8.13.4) with ESMTP id l08GiecI029402 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 8 Jan 2007 17:44:41 +0100 Subject: Re: gdb and dynamic loader namespaces From: mathieu lacage To: Daniel Jacobowitz Cc: gdb@sourceware.org In-Reply-To: <20070108151510.GA14359@nevyn.them.org> References: <1168268998.21818.44.camel@garfield.inria.fr> <20070108151510.GA14359@nevyn.them.org> Content-Type: text/plain Date: Mon, 08 Jan 2007 16:45:00 -0000 Message-Id: <1168274688.11508.2.camel@mathieu> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 (2.8.2.1-2.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]); Mon, 08 Jan 2007 17:44:41 +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-01/txt/msg00120.txt.bz2 On Mon, 2007-01-08 at 10:15 -0500, Daniel Jacobowitz wrote: > On Mon, Jan 08, 2007 at 04:09:58PM +0100, Mathieu Lacage wrote: > > So, I tried to figure out how I could fix this in gdb: a bit of > > debugging shows that gdb is notified of dlmopen calls through the > > r_debug structure since "set stop-on-solib-events 1" triggers correctly > > an event upon dlmopen. The question then is why gdb does not add the new > > binary to its map. Maybe someone more knowledgeable than me about the > > layout of the gdb code source could point me to the piece of code which > > updates and manipulates the gdb map of binaries used during symbol > > lookup ? (I am using an x86 linux system) > > It's in solib-svr4.c. Look especially at current_sos and compare that > to where glibc adds things in namespaces. I doubt they're on the same > list, and in fact they may not even be listed in the public part of > struct r_debug. thanks, > > I'm not sure what gdb would really do with them either. It doesn't > support multiple namespaces of symbols. The (probably naive) idea would be to merge them: they live in separate address spaces so address lookups should be unique. name lookups, on the other hand, could be non-unique but this is nothing new: gdb should already be able to handle multiple answers for a single name lookup, right ? Mathieu