This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/RFA] do not call decode_compound with Ada expressions.
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 16 Dec 2011 12:47:34 -0700
- Subject: Re: [RFC/RFA] do not call decode_compound with Ada expressions.
- References: <1323869653-12503-1-git-send-email-brobecker@adacore.com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> Generally speaking, I think it would probably make sense to always
Joel> perform language-specific checks such as these only when the language
Joel> matches the check. With the current infrastructure, it would lead to
Joel> a lot of "if language is ... then [do...]", which would probably hard
Joel> to maintain, although maybe no less hard than it is now. Perhaps
Joel> the work that KeithS is doing to parse the linespec will allow us
Joel> to have true language-specific evaluation of the linespec. I am
Joel> not sure yet.
I think we should have a good plan for how to handle these things.
If linespec can't be language-independent, then IMO it should be calling
methods on struct language_defn. The current approach of examining the
current_language is quite bad. (And just to be clear, C++ is probably
the worst offender here right now.)
Joel> + /* We really should only be doing this for languages where
Joel> + it actually makes sense. For instance, Ada does not use
Joel> + this type of syntax, and trying to apply this logic on
Joel> + an Ada linespec may trigger a spurious error (for instance,
Joel> + decode_compound does not like expressions such as `ops."<"',
Joel> + which is a valid function name in Ada). */
Joel> + if (current_language->la_language != language_ada)
There is a comment saying this is for C++ and Java.
How about checking explicitly for those and nothing else?
Tom