From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26980 invoked by alias); 10 May 2007 14:52:45 -0000 Received: (qmail 26969 invoked by uid 22791); 10 May 2007 14:52:44 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 May 2007 14:52:41 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id l4AEqcLw142814 for ; Thu, 10 May 2007 14:52:38 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l4AEqbDN3850280 for ; Thu, 10 May 2007 16:52:37 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l4AEqaGD016537 for ; Thu, 10 May 2007 16:52:36 +0200 Received: from [9.152.248.44] (dyn-9-152-248-44.boeblingen.de.ibm.com [9.152.248.44]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l4AEqZ7Y016359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 May 2007 16:52:36 +0200 Message-ID: <4643315F.3070900@de.ibm.com> Date: Thu, 10 May 2007 14:52:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: Daniel Jacobowitz , GDB Patches CC: Ulrich Weigand Subject: Re: [PING] [rfc]: Framework for looking up multiply defined global symbols in shared libraries References: <464310CA.1030602@de.ibm.com> <20070510130030.GA7248@caradoc.them.org> In-Reply-To: <20070510130030.GA7248@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-05/txt/msg00159.txt.bz2 Daniel Jacobowitz wrote: >> As an example I implemented a special lookup routine for ELF shared libraries >> linked with -Bsymbolic. While the focus is within such a library, the global >> symbol lookup shall first search for the symbol within this library and then >> go through the main executable if not found. > > Is this the point of the patch, or just an example? I mean, what else > would you use this for besides -Bsymbolic? > > There's some benefit to looking up the right symbol, e.g. for "print > foo()". But for breakpoints, I still think the way to go is to > breakpoint all functions with the same name and/or allow the user to > specify a copy explicitly (apparently DBX does the latter). > The lookup for the '-Bsymbolic' library is just one example. ELF says that the symbol resolution algorithm for that kind of library shall start within the library instead of the main executable. If this lookup fails the "normal" lookup starting in the main executable shall take place. There'll be another patch using that lookup framework for the combined debugger for Cell. If GDB debugs a Cell binary and stands in a SPU thread (which GDB thinks of as a library) then the lookup of a symbol would prefer the symbol in the main executable (in the PPE thread) if available. The second patch using that framework makes sure that a symbol lookup within a SPU thread prefers symbols from that SPU thread. This framework also makes it possible for other library handlers (sorry, I don't know any examples now) to install their own callbacks if the want to have own algorithms for symbol lookup. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com