From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro_alves@portugalmail.pt>
Cc: gdb-patches@sourceware.org
Subject: Re: Breaking in a c++ method with current language set to c.
Date: Tue, 27 Mar 2007 18:58:00 -0000 [thread overview]
Message-ID: <20070327185802.GD28164@caradoc.them.org> (raw)
In-Reply-To: <45F46F5A.5020906@portugalmail.pt>
On Sun, Mar 11, 2007 at 09:06:34PM +0000, Pedro Alves wrote:
> >How much invasive? I don't like the global "current language"; like
> >the global "selected frame", it's prone to this sort of problem when
> >we'd really rather be looking at a different language.
> As my first approach I had added a new parameter to lookup_symbol, and
> changed all the calls throughout to pass the language that seemed to
> make sense or current_language otherwise. I ended up touching many
> files I wouldn't be able to test, like fortran, scheme, java and ada
> support. It was more invasive than I could afford :) (,and probably wrong).
> As an intermediate step, I came up with this version. It adds a new
> lookup_symbol_in_language, and tweaks a few worker functions to accept
> the language by parameter, instead of relying on the current language.
> lookup_symbol is then a simple wrapper that passes the current_language
> to the new lookup_symbol_in_language. I needed to tweak ada-lang.c,
> because the lookup_symbol_in_language name was already taken there. The
> approach implemented there was similar to my previous patch, that is, it
> temporarily switched the current language [1]. As I don't have an ada
> compiler (and I can't fit any on my machine), I can't be be sure I caught
> all the hard coded current_language uses, so I've just make the ada
> function static and added a FIXME. Maybe someone will be able to try
> with the new version in symtab.c.
> What do you think of this approach?
I like this much better. I tested using your version for Ada, and it
seemed to work - but we don't have test coverage for the problem case,
apparently, since commenting out the set_language call in
ada_lookup_symbol_in_language did not cause any test failures. I
think you should go ahead and remove the Ada-specific version. If
there's a problem we can fix it.
Could you do that, and also check for overly long lines in your patch?
Thanks in advance.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-03-27 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 3:37 Pedro Alves
2007-03-05 12:41 ` Daniel Jacobowitz
2007-03-11 21:07 ` Pedro Alves
2007-03-27 18:58 ` Daniel Jacobowitz [this message]
2007-03-29 0:58 ` Pedro Alves
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=20070327185802.GD28164@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro_alves@portugalmail.pt \
/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