[RFC/RFA] do not call decode_compound with Ada expressions.
Tom Tromey
tromey@redhat.com
Fri Dec 16 19:58:00 GMT 2011
>>>>> "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
More information about the Gdb-patches
mailing list