From: David Carlton <carlton@math.stanford.edu>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Jim Blandy <jimb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: RFA: Search for symbol names the same way they're hashed.
Date: Wed, 02 Oct 2002 12:10:00 -0000 [thread overview]
Message-ID: <ro1y99gsllm.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <20021002180515.GA8880@nevyn.them.org>
On Wed, 2 Oct 2002 14:05:15 -0400, Daniel Jacobowitz <drow@mvista.com> said:
> (What is the right solution? Simple. While lookup_block_symbol
> presumably only returns one symbol, all of GDB needs to be aware
> that lookup_symbol can find more than one. We need a way to
> distinguish them (for static functions in multiple files - often all
> with the same filename! This happens in BFD) and a way to collapse
> them (for cloned constructors, breaking on one should probably break
> on all of them).
Yup. For what it's worth, in my current version of the dictionary
stuff for blocks, I've basically given up on having a dict_lookup
function that returns "the" match: instead, I have
dict_iter_name_{first,next} that allow you to iterate through all
entries in a dictionary whose SYMBOL_BEST_NAME strcmp_iw's to what
you're looking for.
Of course, I still have lookup_block_symbol return a single value, so,
for example, the relevant code in the non-function case for my version
of lookup_block_symbol looks like this:
if (!BLOCK_FUNCTION (block))
{
for (sym = dict_iter_name_first (BLOCK_DICT (block), name, &iter);
sym; sym = dict_iter_name_next (name, &iter))
{
if (SYMBOL_NAMESPACE (sym) == namespace
&& (mangled_name
? strcmp (SYMBOL_NAME (sym), mangled_name) == 0 : 1))
return sym;
}
return NULL;
}
(the BLOCK_FUNCTION (block) case is a little more complicated), but it
should be friendly to adding variants that might find multiple
symbols.
David Carlton
carlton@math.stanford.edu
next prev parent reply other threads:[~2002-10-02 19:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 20:45 Jim Blandy
2002-10-02 10:45 ` David Carlton
2002-10-02 12:35 ` Jim Blandy
2002-10-02 12:41 ` David Carlton
2002-10-02 13:02 ` Daniel Jacobowitz
2002-10-02 13:20 ` David Carlton
2002-10-02 13:25 ` Daniel Jacobowitz
2002-10-02 13:43 ` Daniel Berlin
2002-10-02 14:03 ` Daniel Jacobowitz
2002-10-02 16:10 ` Daniel Berlin
2002-10-02 16:19 ` Setting the demangling style Daniel Jacobowitz
2002-10-02 11:04 ` RFA: Search for symbol names the same way they're hashed Daniel Jacobowitz
2002-10-02 12:10 ` David Carlton [this message]
2002-10-07 16:19 ` David Carlton
2002-10-07 16:38 ` Daniel Jacobowitz
[not found] <1033595444.9324.ezmlm@sources.redhat.com>
2002-10-02 17:49 ` Jim Ingham
2002-10-02 18:16 ` Daniel Jacobowitz
2002-10-02 18:25 ` Jim Ingham
2002-10-03 8:15 ` Daniel Berlin
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=ro1y99gsllm.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=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