From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13239 invoked by alias); 13 Dec 2006 18:13:39 -0000 Received: (qmail 13231 invoked by uid 22791); 13 Dec 2006 18:13:39 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 13 Dec 2006 18:13:30 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GuYbd-0003hG-Rh; Wed, 13 Dec 2006 13:13:25 -0500 Date: Wed, 13 Dec 2006 18:13:00 -0000 From: Daniel Jacobowitz To: Fabian Cenedese Cc: gdb@sourceware.org Subject: Re: Symbols in same range Message-ID: <20061213181325.GA13536@nevyn.them.org> Mail-Followup-To: Fabian Cenedese , gdb@sourceware.org References: <5.2.0.9.1.20061213092734.01881ec0@NT_SERVER> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.2.0.9.1.20061213092734.01881ec0@NT_SERVER> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2006-12/txt/msg00119.txt.bz2 On Wed, Dec 13, 2006 at 09:44:47AM +0100, Fabian Cenedese wrote: > Hi > > Is it correct to have several symbols in the same symtab range? Like: Yes, this is not uncommon. For instance, if one source file defines linkonce routines or functions in multiple sections. I have worked on several problems related to this one lately. Are you using GDB HEAD? If not, does it do any better? Does the patch in this message help? http://sourceware.org/ml/gdb-patches/2006-12/msg00005.html > find_pc_sect_psymtab, pc=0x99928 > lookup_minimal_symbol_by_pc_section > -> msymbol="_INI_0200_INOS" > tpst='Inos_mod.cpp' > find_pc_sect_psymbol > -> p="CEnd" > -> ps='Inos_mod.cpp' > -> s='Inos_mod.cpp' > best_symtab=NULL > -> .line=0 > > The found msymbol is always correct, but when gdb continues to find > the corresponding block it takes the symtab from a wrong file. But the > addresses in there don't match (only the range) and the returned > result is .line=0. There should be a psymbol in the correct psymtab which is closer to the specified pc. What symbols are at or directly before that location? > Is this an error in the finding strategy of gdb, like, it should look > in all symtabs and not only in the first whose range matches? It should find the correct psymtab. You'll see that find_pc_sect_psymtab actually loops over them all. -- Daniel Jacobowitz CodeSourcery