From patchwork Thu Nov 30 03:01:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 24617 Received: (qmail 102393 invoked by alias); 30 Nov 2017 03:01:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 102337 invoked by uid 89); 30 Nov 2017 03:01:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:sk:cm11.we, H*RU:100.42.49.5, Hx-spam-relays-external:100.42.49.5, H*RU:sk:cm11.we X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.194.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Nov 2017 03:01:45 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 25C92BC35 for ; Wed, 29 Nov 2017 21:01:44 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id KF6eeSN9ItuxmKF6eelAja; Wed, 29 Nov 2017 21:01:44 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:57898 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eKF6d-002PmB-SJ; Wed, 29 Nov 2017 21:01:43 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 3/6] Remove cleanup from print_mention_exception Date: Wed, 29 Nov 2017 20:01:37 -0700 Message-Id: <20171130030140.14830-4-tom@tromey.com> In-Reply-To: <20171130030140.14830-1-tom@tromey.com> References: <20171130030140.14830-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eKF6d-002PmB-SJ X-Source-Sender: 71-218-90-63.hlrn.qwest.net (bapiya.Home) [71.218.90.63]:57898 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This removes a cleanup from print_mention_exception by using string_printf. ChangeLog 2017-11-29 Tom Tromey * ada-lang.c (print_mention_exception): Use std::string. --- gdb/ChangeLog | 4 ++++ gdb/ada-lang.c | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 28df250104..0248663ba8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12537,11 +12537,9 @@ print_mention_exception (enum ada_exception_catchpoint_kind ex, case ada_catch_exception: if (c->excep_string != NULL) { - char *info = xstrprintf (_("`%s' Ada exception"), c->excep_string); - struct cleanup *old_chain = make_cleanup (xfree, info); - - uiout->text (info); - do_cleanups (old_chain); + std::string info = string_printf (_("`%s' Ada exception"), + c->excep_string); + uiout->text (info.c_str ()); } else uiout->text (_("all Ada exceptions"));