This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix C++ regression for bpt conditionals
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 07 Jan 2013 08:07:55 -0700
- Subject: Re: [patch] Fix C++ regression for bpt conditionals
- References: <20130104212150.GA4048@host2.jankratochvil.net>
>>>>> "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