From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10370 invoked by alias); 14 Dec 2006 09:51:28 -0000 Received: (qmail 10360 invoked by uid 22791); 14 Dec 2006 09:51:27 -0000 X-Spam-Check-By: sourceware.org Received: from mxout.hispeed.ch (HELO smtp.hispeed.ch) (62.2.95.247) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Dec 2006 09:51:21 +0000 Received: from indel.ch (84-73-11-232.dclient.hispeed.ch [84.73.11.232]) by smtp.hispeed.ch (8.12.11.20060308/8.12.11/taifun-1.0) with SMTP id kBE9pHqN021913 for ; Thu, 14 Dec 2006 10:51:18 +0100 Received: from FABI.indel.ch [192.168.1.91] by indel.ch [127.0.0.1] with SMTP (MDaemon.v2.7.SP5.R) for ; Thu, 14 Dec 2006 10:50:56 +0100 Message-Id: <5.2.0.9.1.20061214093554.01881b80@NT_SERVER> X-Sender: cenedese@NT_SERVER (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Thu, 14 Dec 2006 09:51:00 -0000 To: gdb@sourceware.org From: Fabian Cenedese Subject: Re: Symbols in same range In-Reply-To: <20061213181325.GA13536@nevyn.them.org> References: <5.2.0.9.1.20061213092734.01881ec0@NT_SERVER> <5.2.0.9.1.20061213092734.01881ec0@NT_SERVER> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MDaemon-Deliver-To: gdb@sourceware.org X-Return-Path: cenedese@indel.ch X-Virus-Status: Clean X-DCC-spamcheck-01.tornado.cablecom.ch-Metrics: smtp-08.tornado.cablecom.ch 1377; Body=1 Fuz1=1 Fuz2=1 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/msg00127.txt.bz2 At 13:13 13.12.2006 -0500, Daniel Jacobowitz wrote: >On Wed, Dec 13, 2006 at 09:44:47AM +0100, Fabian Cenedese wrote: >> 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 Unfortunately not. But then again I'm on 6.5 so there may be other changes related to it. I can't change to HEAD right now but maybe some time later. "This is a loop over all psymtabs and a fearsome lot of symbol lookups;" Yeah, I sometimes thought so as well :) >> 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. I'm sure now that the algorithm is working fine. The main problem is that there are no matching psymtabs. find_pc_sect_psymtab (CORE_ADDR pc, asection *section) ... ALL_PSYMTABS (objfile, pst) { if (pc >= pst->textlow && pc < pst->texthigh) The biggest pst->texthigh is the one from the last symbol in the .text section. For some reason there are no psymbols for the other code sections. So my problem lies probably more in the reading and creating of those symbols, or even in gcc's debug info. When I put the other code in the .text section as well it works fine. Thanks bye Fabi