From: David Carlton <carlton@math.stanford.edu>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com, Jim Blandy <jimb@redhat.com>
Subject: Re: [rfa] delete macro SYMBOL_LINKAGE_NAME
Date: Mon, 03 Feb 2003 18:41:00 -0000 [thread overview]
Message-ID: <ro1k7gh9pg1.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <15934.46400.598795.544205@localhost.redhat.com>
On Mon, 3 Feb 2003 13:30:24 -0500, Elena Zannoni <ezannoni@redhat.com> said:
> David Carlton writes:
>> This is the first part of my plan to clean up symbol accessors. It
>> deletes the macro SYMBOL_LINKAGE_NAME: that macro is only used in
>> two places in one function, and is easy to replace by an equivalent
>> use of asm_demangle, SYMBOL_SOURCE_NAME, and SYMBOL_NAME. Given
>> that I'd like to use the name SYMBOL_LINKAGE_NAME for something
>> else, I'd like to get rid of its current use.
> can you expand a bit?
As I posted in
<http://sources.redhat.com/ml/gdb/2003-01/msg00188.html>, I really
think that it's important to clean up GDB's use of various names. I
want to make it as easy as possible for people to get at either the
source code names of symbols or the linkage names of symbols, and to
make it clear when they mean the one or the other. For the linkage
names, the best macro name that I've come up with is
SYMBOL_LINKAGE_NAME: so a not-to-distant step in this process will be
to introduce a macro SYMBOL_LINKAGE_NAME whose definition is exactly
the same as the definition of SYMBOL_NAME, but with the extra semantic
benefit that users of that macro will promise that they've actually
thought about the situation and decided that they really want the
linkage name instead of the source code name.
But to do that, I have to get rid of the existing macro
SYMBOL_LINKAGE_NAME. (Or else think up another name, but here getting
rid of the existing macro seems preferable.)
I'm certainly open to different names for these macros, if you'd
prefer something else. (Though I do think that getting rid of the
current SYMBOL_LINKAGE_NAME wouldn't be a bad idea, given how little
it's used.)
>> if (symbol)
>> {
>> name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol));
>> - if (do_demangle)
>> + if (do_demangle || asm_demangle)
> why this change? I must be missing something.
>> name_temp = SYMBOL_SOURCE_NAME (symbol);
>> else
>> - name_temp = SYMBOL_LINKAGE_NAME (symbol);
>> + name_temp = SYMBOL_NAME (symbol);
>> }
> this one is ok.
The current SYMBOL_LINKAGE_NAME (that I'm getting rid of) is
equivalent, I think, to
asm_demangle ? SYMBOL_SOURCE_NAME : SYMBOL_NAME.
So the old code
if (do_demangle)
name_temp = SYMBOL_SOURCE_NAME (symbol);
else
name_temp = SYMBOL_LINKAGE_NAME (symbol);
becomes
if (do_demangle)
name_temp = SYMBOL_SOURCE_NAME (symbol);
else
{
if (asm_demangle)
name_temp = SYMBOL_SOURCE_NAME (symbol);
else
name_temp = SYMBOL_NAME (symbol);
}
And then I combined the first two if statements into an or statement.
David Carlton
carlton@math.stanford.edu
next prev parent reply other threads:[~2003-02-03 18:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-21 0:58 David Carlton
2003-02-03 18:30 ` Elena Zannoni
2003-02-03 18:41 ` David Carlton [this message]
2003-02-04 17:00 ` Elena Zannoni
2003-02-04 21:38 ` David Carlton
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=ro1k7gh9pg1.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=ezannoni@redhat.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