From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18313 invoked by alias); 13 Feb 2019 21:29:41 -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 17981 invoked by uid 89); 13 Feb 2019 21:29:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=controlling X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.39) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Feb 2019 21:29:34 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 9940B3DD48 for ; Wed, 13 Feb 2019 15:29:32 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id u260glcEz2qH7u260gJY9b; Wed, 13 Feb 2019 15:29:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6XPcBGFsMMmrmMUI/pKLC6iq9mRPRCHkxWdX17ZTSwo=; b=l3kz67LlkwfI0SOFIhQiZN7NgD zSmw80nCxUXKUHUNKpqPY5paJQPOnYMg3EbsadZqXiIDtPVWWXBu1E5FPb4QACTgXUdxg40yTRAfN elAKFNsr9xCp19LKPDlzkCLRL; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:42554 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gu260-001UWe-C5; Wed, 13 Feb 2019 15:29:32 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 08/20] Remove last cleanup solib-aix.c Date: Wed, 13 Feb 2019 21:30:00 -0000 Message-Id: <20190213212927.9474-9-tom@tromey.com> In-Reply-To: <20190213212927.9474-1-tom@tromey.com> References: <20190213212927.9474-1-tom@tromey.com> X-SW-Source: 2019-02/txt/msg00204.txt.bz2 This removes the last cleanup solib-aix.c, replacing it with a use of make_scope_exit. gdb/ChangeLog 2019-02-13 Tom Tromey * solib-aix.c: Use make_scope_exit. --- gdb/ChangeLog | 4 ++++ gdb/solib-aix.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 85c05a42ebf..c5fb7d58525 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -26,6 +26,7 @@ #include "xcoffread.h" #include "observable.h" #include "gdbcmd.h" +#include "common/scope-exit.h" /* Variable controlling the output of the debugging traces for this module. */ @@ -242,18 +243,19 @@ static VEC (lm_info_aix_p) * solib_aix_parse_libraries (const char *library) { VEC (lm_info_aix_p) *result = NULL; - struct cleanup *back_to = make_cleanup (solib_aix_free_library_list, - &result); + auto cleanup = make_scope_exit ([&] () + { + solib_aix_free_library_list (&result); + }); if (gdb_xml_parse_quick (_("aix library list"), "library-list-aix.dtd", library_list_elements, library, &result) == 0) { /* Parsed successfully, keep the result. */ - discard_cleanups (back_to); + cleanup.release (); return result; } - do_cleanups (back_to); return NULL; } -- 2.17.2