This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patchv2] Fix C++ regression for bpt conditionals


On Wed, 09 Jan 2013 16:12:45 +0100, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> Jan> +  inner_chain = make_cleanup_restore_current_language ();
> Jan> +
> Jan> +  /* get_current_arch may reset CURRENT_LANGUAGE via select_frame.  */
> Jan>    initialize_expout (10, lang, get_current_arch ());
>  
> Jan> +  set_language (lang->la_language);
> 
> This will restore current_language to its value before get_current_arch
> is called.
> 
> But IIRC in your original note you said that this is the call that
> changes current_language.
> 
> I am not sure, but I think we don't want to lose this language change.
> It seems like it could be the spot that causes the transition from
> "minimal" to whatever language "main" (or whatever) is using.

There is some non-trivial code trying to determine LANG from BLOCK, FUNC etc.
I believe LANG should be right.  If LANG is not right then there is wrong for
example the existing code:
       if (lang->la_parser ())

I did not try to debug the LANG determining code, IMO it works right.
IMO the only wrong case is if CURRENT_LANGUAGE is different from LANG (if we
follow your way of fixing the issue, which seems OK to me).
(BTW PARSE_LANGUAGE is already always equal to LANG.)


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]