This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Don't preserve `uiout' across TRY_CATCH.
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 03 Aug 2011 13:27:10 -0600
- Subject: Re: Don't preserve `uiout' across TRY_CATCH.
- References: <201108031910.42133.pedro@codesourcery.com>
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> I think that's wrong for TRY_CATCH to do - TRY_CATCH should be a
Pedro> low level exceptions framework, and it should be catch_errors and
Pedro> whatever other callers that want to preserve uiout that should
Pedro> guarantee uiout is preserved.
I completely agree. Thanks for doing this.
Want to see something (sort of) related and gross? From
throw_exception:
/* Perhaps it would be cleaner to do this via the cleanup chain (not sure
I can think of a reason why that is vital, though). */
if (tp != NULL)
{
/* Clear queued breakpoint commands. */
bpstat_clear_actions (tp->control.stop_bpstat);
}
disable_current_display ();
Pedro> `uiout' is not a great name for grepping for uses. I'll post a
Pedro> followup that renames it to `current_uiout'.
Thanks, that sounds great. One step closer to -Wshadow :-)
Pedro> Tested on x86_64-linux. Anyone see a problem with this?
It is hard to know whether it will uncover a problem somewhere, but TBH
I would rather put it in and find out. I did spot-check assignments to
uiout (there aren't many according to my quick grep) and didn't see
anything.
Tom