From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81412 invoked by alias); 14 Dec 2017 15:16:53 -0000 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 Received: (qmail 81401 invoked by uid 89); 14 Dec 2017 15:16:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=eyes X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Dec 2017 15:16:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C05E0116E0E; Thu, 14 Dec 2017 10:16:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SM4ZKsQHlSLO; Thu, 14 Dec 2017 10:16:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 58515116DD2; Thu, 14 Dec 2017 10:16:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 15F3B82EAA; Thu, 14 Dec 2017 19:16:46 +0400 (+04) Date: Thu, 14 Dec 2017 15:16:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: Xavier Roirand , Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [RFA] (Ada) New command to stop at start of exception handler. Message-ID: <20171214151646.nsza3mwxzd7r6fl5@adacore.com> References: <1513094242-2313-1-git-send-email-roirand@adacore.com> <20171214142957.ntnoteiheetx4qb2@adacore.com> <1247dee1-2dd6-5cc6-576c-d555557644c8@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1247dee1-2dd6-5cc6-576c-d555557644c8@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2017-12/txt/msg00348.txt.bz2 > You can do: > > std::string info = string_printf (_("`%s' Ada exception hanlder"), > c->excep_string); > > .... > > uiout->text (info.c_str ()); > > and then you no longer have to worry about explicitly > calling xfree, or, leaking if uiout->text() throws > (which it can, if it paginates and the user aborts, for > example). > > But there's also uiout->field_fmt(), which may be > better here if the field is supposed to be an MI attribute: > > uiout->field_fmt ("somename", > _("`%s' Ada exception hanlder"), > c->excep_string); > > Also, typo "hanlder" in format string. :-) Thanks for the additional pair of eyes and suggestions, Pedro. > I haven't really read the description of the command / use case, > but this sounds very much like the existing "catch catch"? Yes, that's the equivalent, but for Ada exceptions. -- Joel