From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20669 invoked by alias); 4 Aug 2011 18:26:36 -0000 Received: (qmail 20661 invoked by uid 22791); 4 Aug 2011 18:26:35 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 18:26:22 +0000 Received: (qmail 4789 invoked from network); 4 Aug 2011 18:26:21 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Aug 2011 18:26:21 -0000 From: Pedro Alves To: Tom Tromey Subject: Re: Don't preserve `uiout' across TRY_CATCH. Date: Thu, 04 Aug 2011 18:26:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201108031910.42133.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201108041926.16697.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00077.txt.bz2 On Wednesday 03 August 2011 20:27:10, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves 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 (); Yeah, that so needs to go away! Any inner exception that is caught and handled potentially breaks breakpoints and displays... > 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 :-) Coming up as soon as I manage to write the ChangeLog. :-P > 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. Thanks. I applied it. -- Pedro Alves