Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@kealia.com>
To: Hilfinger@gnat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: Interactions of symbol-lookup with language
Date: Mon, 10 Nov 2003 17:07:00 -0000	[thread overview]
Message-ID: <yf2he1c6tjm.fsf@hawaii.kealia.com> (raw)
In-Reply-To: <200311082255.hA8MtJK08216@otisco.McKusick.COM> (Paul N. Hilfinger's message of "Sat, 8 Nov 2003 14:55:19 -0800")

On Sat, 8 Nov 2003 14:55:19 -0800, "Paul N. Hilfinger"
<hilfingr@otisco.mckusick.com> said:

> In particular, in decode_line_1, there is a call to find_imps, an
> Objective C function, which in turn calls lookup_symbol.  When
> decode_line_1 is called while in Ada mode, this latter lookup_symbol
> acts like an Ada symbol lookup, which makes little sense given that
> find_imps is concerned with Objective C code.  We have encountered
> cases where the result is anomalous.

Ugh.  I suppose it makes sense that the problem would arise in
decode_line_1, though: by its nature, it often gets invoked to refer
to functions in other files, which might be in other languages.

> Our fix for the moment is simply to put a wrapper around decode_objc
> to force the language to objc temporarily.  We are a little
> uncomfortable with submitting this kind of kludge publicly, and
> would prefer something officially blessed.  One possibility is to
> have a variant of lookup_symbol that allows one to specify a
> prevailing language for those cases where it matters.  We have at
> least one other place where we'd like to "look up a symbol as in C".

That kludge wouldn't bother me too much if it were an isolated thing,
but given that it's occurring more than once, I like your idea of
adding a variant of lookup_symbol that specifies a language.  My
suggestions would be:

* The comment before the new function should make it clear that the
  'name' argument should be a demangled name.  (Assuming, of course,
  that that fits all of the places where it's being used; if not, I'd
  like to hear about the exceptions.)  It's okay for the
  implementation to call lookup_symbol (even though that function
  would then try to demangle it) - it's just that I've been trying to
  figure out which functions take demangled names and which functions
  take mangled names, and I don't want new functions to muddy the
  waters.

* Don't add in all the arguments from lookup_symbol: just add in the
  ones you need.  That function has too many arguments as it is, even
  though only certain combinations of arguments ever get used; I'd
  rather have new functions provide cleaner interfaces.  (We can
  always add more arguments later if they're needed, after all.)

David Carlton
carlton@kealia.com


  reply	other threads:[~2003-11-10 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-08 22:55 Paul N. Hilfinger
2003-11-10 17:07 ` David Carlton [this message]
2004-01-20 10:16   ` [RFC] Proposed changes in symbol-handling for Ada Paul Hilfinger
2004-01-20 15:01     ` Daniel Jacobowitz
2004-01-21 10:55       ` Paul Hilfinger
2004-01-21 15:19         ` Daniel Jacobowitz
2004-01-23 21:08           ` Andrew Cagney
2004-01-20 23:05     ` David Carlton
2004-01-21 11:22       ` Paul Hilfinger
2004-01-21 16:49         ` David Carlton
2004-01-21 18:50           ` Daniel Jacobowitz
2003-11-11  1:23 ` Interactions of symbol-lookup with language Elena Zannoni

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=yf2he1c6tjm.fsf@hawaii.kealia.com \
    --to=carlton@kealia.com \
    --cc=Hilfinger@gnat.com \
    --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