From patchwork Wed Jan 9 03:34:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31002 Received: (qmail 36849 invoked by alias); 9 Jan 2019 03:34:35 -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 36706 invoked by uid 89); 9 Jan 2019 03:34:34 -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: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.148.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 03:34:32 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway34.websitewelcome.com (Postfix) with ESMTP id AAC2AFAF7B7 for ; Tue, 8 Jan 2019 21:34:30 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id h4dSge4Gm90onh4dSg8Bwt; Tue, 08 Jan 2019 21:34:30 -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=umdlPRn/sTVC3usLSi3kh8cpCBu56zeaQFQdsXqv08Y=; b=FYfSyElM0rgYwtQqs1ITOQReiq QC/bv1LftJwnlvCtCTsxwcYe2f5JzibTGDnXDb2+U0KrdrQou9QyyTrUCOKnUYwq59JVbK7IgyJTx 6+QEuFqYJfuIAamlb+GfFJd4s; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:47026 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gh4dS-000HG2-GR; Tue, 08 Jan 2019 21:34:30 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 07/12] Remove delete_just_stopped_threads_infrun_breakpoints_cleanup Date: Tue, 8 Jan 2019 20:34:21 -0700 Message-Id: <20190109033426.16062-8-tom@tromey.com> In-Reply-To: <20190109033426.16062-1-tom@tromey.com> References: <20190109033426.16062-1-tom@tromey.com> This removes delete_just_stopped_threads_infrun_breakpoints_cleanup, replacing it with a use of cleanup_function. gdb/ChangeLog 2019-01-08 Tom Tromey * infrun.c (wait_for_inferior): Use cleanup_function. (delete_just_stopped_threads_infrun_breakpoints_cleanup): Remove. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 17 ++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index d84ed10b61..9e3b1fb6ef 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3248,14 +3248,6 @@ delete_just_stopped_threads_single_step_breakpoints (void) for_each_just_stopped_thread (delete_single_step_breakpoints); } -/* A cleanup wrapper. */ - -static void -delete_just_stopped_threads_infrun_breakpoints_cleanup (void *arg) -{ - delete_just_stopped_threads_infrun_breakpoints (); -} - /* See infrun.h. */ void @@ -3539,15 +3531,12 @@ prepare_for_detach (void) void wait_for_inferior (void) { - struct cleanup *old_cleanups; - if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: wait_for_inferior ()\n"); - old_cleanups - = make_cleanup (delete_just_stopped_threads_infrun_breakpoints_cleanup, - NULL); + cleanup_function defer_delete_threads + (delete_just_stopped_threads_infrun_breakpoints); /* If an error happens while handling the event, propagate GDB's knowledge of the executing state to the frontend/user running @@ -3584,8 +3573,6 @@ wait_for_inferior (void) /* No error, don't finish the state yet. */ finish_state.release (); - - do_cleanups (old_cleanups); } /* Cleanup that reinstalls the readline callback handler, if the