From: Elena Zannoni <ezannoni@redhat.com>
To: David Carlton <carlton@bactrian.org>
Cc: gdb-patches@sources.redhat.com, Elena Zannoni <ezannoni@redhat.com>
Subject: Re: [rfa] language hooks for lookup_symbol
Date: Mon, 19 May 2003 15:14:00 -0000 [thread overview]
Message-ID: <16072.62998.398450.521135@localhost.redhat.com> (raw)
In-Reply-To: <m3d6ifyirg.fsf@papaya.bactrian.org>
David Carlton writes:
> Here's a patch to add language hooks to lookup_symbol. I settled on
> two hooks: one of them is a boolean saying whether or not to do the
> field of this check, and the other is a function that replaces the
> static/global lookup part of lookup_symbol_aux. The reason why I
> broke these up into two separate parts is that the field of this part
> doesn't return a symbol, so it's a little hard to do it gracefully and
> without duplicating code. It also provides some functions that other
> languages can use to build nonlocal hook functions if necessary.
>
> The only potential behavior change (I hope) is that I turned off the
> field of this check for the C, asm, and minimal languages. Doubtless
> it should be turned off for other languages, too, but I didn't want to
> tamper with them. This patch tells all languages to use a function
> basic_lookup_symbol_nonlocal that implements the standard C behavior
> that lookup_symbol_aux had been doing. (I'll submit the C++ namespace
> stuff in my next patch.)
>
> It also deletes the strange #if 0 hunk from lookup_symbol_aux; if you
> want, I can commit that change as a separate patch.
>
> This is my first time playing around with struct language_defn, so
> please let me know if I did anything wrong. I like this idea; I
> really should spend time thinking about where else we should use it.
> For example, should lookup_symbol call language_demangle instead of
> cplus_demangle? Hmm.
Yes. I like it.
A couple of comments.
1. check in the if0 elimination by itself, then the deletion of
static_block parameter and teh addition of the block_static_bloc
function. After that check in the rest (which is really the big change).
2. I think that instead of: int la_lookup_symbol_this; We can just
have the new field be a function pointer to NULL or to the
value_of_this function itself. This function itself can be split
in 2, one for objc and one for c++.
3. move the comments as well, instead of deleting them.
demangle? probably so, it will be much cleaner if that gets moved too
(eventually). Other thought, Adam added a few if language == objc
checks in other parts of generic code. Those are also candidate for
hooks, if you feel lucky! At the very least, they should not conflict
with your changes, and should be included in the 'grand plan'. At a
first look I don't think they will create any problems.
> +/* Lookup a symbol in all files' global blocks (searching psymtabs if
> + necessary). */
> +
> +struct symbol *lookup_symbol_global (const char *name,
> + const char *linkage_name,
> + const domain_enum domain,
> + struct symtab **symtab)
watch out for grep ^func.....
next prev parent reply other threads:[~2003-05-19 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-18 22:47 David Carlton
2003-05-19 15:14 ` Elena Zannoni [this message]
2003-05-19 19:23 ` David Carlton
2003-05-19 19:52 ` Elena Zannoni
2003-05-20 2:01 ` 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=16072.62998.398450.521135@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=carlton@bactrian.org \
--cc=gdb-patches@sources.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