Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Fabian Cenedese <Cenedese@indel.ch>
To: gdb@sourceware.org
Subject: Re: Symbols in same range
Date: Thu, 14 Dec 2006 09:51:00 -0000	[thread overview]
Message-ID: <5.2.0.9.1.20061214093554.01881b80@NT_SERVER> (raw)
In-Reply-To: <20061213181325.GA13536@nevyn.them.org>

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



      reply	other threads:[~2006-12-14  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-13  8:46 Fabian Cenedese
2006-12-13 18:13 ` Daniel Jacobowitz
2006-12-14  9:51   ` Fabian Cenedese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.2.0.9.1.20061214093554.01881b80@NT_SERVER \
    --to=cenedese@indel.ch \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox