From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114508 invoked by alias); 27 Feb 2019 20:18:58 -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 114343 invoked by uid 89); 27 Feb 2019 20:18:57 -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= X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Feb 2019 20:18:56 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 1CAF7430CC for ; Wed, 27 Feb 2019 14:18:55 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id z5fLg8rYudnCez5fLg58Z2; Wed, 27 Feb 2019 14:18:55 -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=5bW6ngv9ZWQPnZM7/opc8pcWvCYCxwswhkvPgaOltGE=; b=MdLUiEAONwyBlQw6z/X8dX16jz W9YTy3n//NcVe5KhV0nnj6c83a0FUEXclaaMm5iPVGRWe5awSwtBSVt/IPr1FdnUqfkB5BYpW8Lgm w7sWeuwiUoMi12HExq1LZD3qG; Received: from 75-166-85-218.hlrn.qwest.net ([75.166.85.218]:36364 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gz5fK-004Fi1-SF; Wed, 27 Feb 2019 14:18:54 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 08/22] Remove last cleanup solib-aix.c Date: Wed, 27 Feb 2019 20:18:00 -0000 Message-Id: <20190227201849.32210-9-tom@tromey.com> In-Reply-To: <20190227201849.32210-1-tom@tromey.com> References: <20190227201849.32210-1-tom@tromey.com> X-SW-Source: 2019-02/txt/msg00518.txt.bz2 This removes the last cleanup solib-aix.c, replacing it with a use of make_scope_exit. gdb/ChangeLog 2019-02-27 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