Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: don't use minsym name when searching block
Date: Thu, 29 Aug 2002 14:51:00 -0000	[thread overview]
Message-ID: <20020829215155.GA24578@nevyn.them.org> (raw)
In-Reply-To: <vt2sn0xtl33.fsf@zenia.red-bean.com>

On Thu, Aug 29, 2002 at 04:24:16PM -0500, Jim Blandy wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > On Thu, Aug 22, 2002 at 12:26:51AM -0500, Jim Blandy wrote:
> > > 
> > > I'd appreciate it if the C++ folks could check this out.  I don't have
> > > a test case yet, but I'll try to put one together tomorrow.
> > 
> > Could you describe the problem?  Also... "the minsym's name might be
> > mangled" definitely seems like a problem; they should either be
> > consistently mangled or demangled...
> 
> Minimal symbol names are consistently mangled, which makes sense:
> they're linker symbols, after all.  You have to use
> SYMBOL_DEMANGLED_NAME to get a minsym's demangled name.  But the names
> of real symbols (struct symbol) are always demangled.  So when we pass
> SYMBOL_NAME (msymbol) to lookup_block_symbol, we're passing a name
> guaranteed to be mangled to a function that expects a demangled name.
> 
> I'm working on a test case for this.  The symptom is that, when you
> try to set a breakpoint on a method, say foo::bar, you get an error
> message, but if you then repeat the exact same command, it works the
> second time.

Oh!  In that case, I think I have a test case for it tucked away in a
bug report; I'll look for it.  That makes much more sense now.

> What's going on is that, the first time we call lookup_symbol_aux,
> which is passed both the mangled name and the demangled name, we hit
> the case being patched: we find a minsym, and read the symtab whose
> address range contains the minsym's value.  However, since we then
> search the global and static blocks using the mangled name, we fail.
> 
> The second time we try to lookup foo::bar, the symtab has been read,
> and the ALL_SYMTABS loop finds the symbol.

Thanks for the explanation.  Shouldn't the code that does the same
thing in the (#&@ HPUXHPPA block further down have the same fix
applied?  Other than that, it looks good to me.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-08-29 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-21 22:37 Jim Blandy
2002-08-22  6:54 ` Daniel Jacobowitz
2002-08-22  5:50   ` Daniel Jacobowitz
2002-08-29 14:41   ` Jim Blandy
2002-08-29 14:51     ` Daniel Jacobowitz [this message]
2002-08-29 21:01       ` Jim Blandy
2002-08-24  5:30 ` Peter.Schauer
2002-08-29 14:43   ` Jim Blandy
2002-08-29 14:50     ` Daniel Jacobowitz

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=20020829215155.GA24578@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    /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