[patch] Fix C++ regression for bpt conditionals

Tom Tromey tromey@redhat.com
Mon Jan 7 15:08:00 GMT 2013


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> It is because at the following moment current_language gets reset to
Jan> c_language during startup of the inferior.

Ouch.

Jan> I find it a latent bug that just got exposed by the check-in above.

I agree your fix helps, however I doubt it is enough.  For example,
check_typedef calls lookup_transparent_type, and this uses
current_language.  So, we may still have an obscure bug along that path
if the parser ever calls check_typedef.

Maybe this one can't happen?  Or doesn't have a bad impact?  I don't
really know.

Jan> The testcase is fixed by the classify_name change but I find all
Jan> the calls of lookup_symbol from *.y files incorrect.  I would find
Jan> "#define lookup_symbol BUG" right there but I see here some
Jan> opposition to such compiler checking constructs.

I wouldn't oppose the BUG idea.


Another idea for the fix would be to set current_language in
parse_exp_in_context after calling get_current_arch, then reset it again
in a cleanup.  This also may not be foolproof.

Tom



More information about the Gdb-patches mailing list