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: [RFC/commit] parse breakpoint condition according to breakpoint location


> current_language is a problem global.  It is referenced in a lot of
> places where an argument would be preferable.  E.g., even though
> expressions carry their language, code in valops.c checks the global, so
> you can wind up with odd behavior (at least in theory, I have not tried
> to make a reproducer).  Probably, evaluate_expression should call
> set_language and restore the old language in a cleanup -- though this is
> a workaround and not a clean fix.

I see that you already starting cleaning some things up in that
department :).

The idea of temporarily switching the current_language global is not
even guaranteed to work, because there is the risk that some functions
that we use actually change it again from under us.  For instance, a
while ago, I ran into a situation where a some code set the
current_language before calling a parsing routine; but that did not work
because the parsing routine called get_current_frame which had a
side-effect of changing the current_language!

> Once the condition is successfully parsed, it seems to me that any
> re-parsing should be done with that same language.

Agreed 100%.

> Maybe this is already accomplished by the set_language calls in
> breakpoint.c, I'm not sure.

I do not think so. I need to work on that followup email I was
referring to (I'm in Paris right now, spending most of my days
meeting with people). I'll do that now...

-- 
Joel


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