From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18053 invoked by alias); 13 Feb 2019 21:29:39 -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 17764 invoked by uid 89); 13 Feb 2019 21:29:38 -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: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Feb 2019 21:29:33 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 026EF3CE6A0 for ; Wed, 13 Feb 2019 15:29:32 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id u25zgSDkV4FKpu25zgmjBH; Wed, 13 Feb 2019 15:29:31 -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=VO+qD65yvR3eWqAe6O2Yg/xzzrGp8+Bi/YJR6t/7hsw=; b=Cy1VFBvqoSUjTe/xGKecxqgyfY ez75liNY+ecr+DdtCix+D/e/cibQeM8YAcXC/KkrWPnS6OtEZut4m/LyV2bvfDAQxbahi5T6VYwKU AQO/8nWBWghqsDVMWawMg7ykl; 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 1gu25z-001UWe-Ps; Wed, 13 Feb 2019 15:29:31 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 06/20] Remove cleanup from solib-svr4.c Date: Wed, 13 Feb 2019 21:29:00 -0000 Message-Id: <20190213212927.9474-7-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/msg00198.txt.bz2 This removes a cleanup from solib-svr4.c, replacing it with make_scope_exit. gdb/ChangeLog 2019-02-13 Tom Tromey * solib-svr4.c (disable_probes_interface): Remove parameter. (svr4_handle_solib_event): Use make_scope_exit. --- gdb/ChangeLog | 5 +++++ gdb/solib-svr4.c | 40 ++++++++++------------------------------ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 787b98ba266..2b370ef96d0 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1826,7 +1826,7 @@ solist_update_incremental (struct svr4_info *info, CORE_ADDR lm) ones set up for the probes-based interface are adequate. */ static void -disable_probes_interface_cleanup (void *arg) +disable_probes_interface () { struct svr4_info *info = get_svr4_info (); @@ -1847,7 +1847,6 @@ svr4_handle_solib_event (void) struct svr4_info *info = get_svr4_info (); struct probe_and_action *pa; enum probe_action action; - struct cleanup *old_chain; struct value *val = NULL; CORE_ADDR pc, debug_base, lm = 0; struct frame_info *frame = get_current_frame (); @@ -1858,26 +1857,20 @@ svr4_handle_solib_event (void) /* If anything goes wrong we revert to the original linker interface. */ - old_chain = make_cleanup (disable_probes_interface_cleanup, NULL); + auto cleanup = make_scope_exit (disable_probes_interface); pc = regcache_read_pc (get_current_regcache ()); pa = solib_event_probe_at (info, pc); if (pa == NULL) - { - do_cleanups (old_chain); - return; - } + return; action = solib_event_probe_action (pa); if (action == PROBES_INTERFACE_FAILED) - { - do_cleanups (old_chain); - return; - } + return; if (action == DO_NOTHING) { - discard_cleanups (old_chain); + cleanup.release (); return; } @@ -1907,25 +1900,16 @@ svr4_handle_solib_event (void) END_CATCH if (val == NULL) - { - do_cleanups (old_chain); - return; - } + return; debug_base = value_as_address (val); if (debug_base == 0) - { - do_cleanups (old_chain); - return; - } + return; /* Always locate the debug struct, in case it moved. */ info->debug_base = 0; if (locate_base (info) == 0) - { - do_cleanups (old_chain); - return; - } + return; /* GDB does not currently support libraries loaded via dlmopen into namespaces other than the initial one. We must ignore @@ -1943,7 +1927,6 @@ svr4_handle_solib_event (void) CATCH (ex, RETURN_MASK_ERROR) { exception_print (gdb_stderr, ex); - do_cleanups (old_chain); return; } END_CATCH @@ -1968,13 +1951,10 @@ svr4_handle_solib_event (void) if (action == FULL_RELOAD) { if (!solist_update_full (info)) - { - do_cleanups (old_chain); - return; - } + return; } - discard_cleanups (old_chain); + cleanup.release (); } /* Helper function for svr4_update_solib_event_breakpoints. */ -- 2.17.2