From patchwork Wed Jan 9 03:34:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31006 Received: (qmail 37054 invoked by alias); 9 Jan 2019 03:34:37 -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 36698 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=infrunc, UD:infrun.c, infrun.c X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 03:34:32 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id EF911269E for ; Tue, 8 Jan 2019 21:34:30 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id h4dSgfgdX2qH7h4dSgKYsh; 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=YwE/F2/XclVfOpG8iyO/rpjH36LdLp/dTeVKsXojfqU=; b=wJUV8ChYKFzOBmG6erediVN8ay G/rAR377fCzpkew/SFlX4C1cEHCWlyWtB9HOr6nx2EJgMMOmmUAc0WI4j7cXV/vKaa5BiQy8Opuul t1ks0suLKIvvAsXs47ntvcoEb; 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-PD; Tue, 08 Jan 2019 21:34:30 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 08/12] Remove cleanup from stop_all_threads Date: Tue, 8 Jan 2019 20:34:22 -0700 Message-Id: <20190109033426.16062-9-tom@tromey.com> In-Reply-To: <20190109033426.16062-1-tom@tromey.com> References: <20190109033426.16062-1-tom@tromey.com> This removes the cleanup from stop_all_threads, replacing it with a cleanup_function. gdb/ChangeLog 2019-01-08 Tom Tromey * infrun.c (disable_thread_events): Remove argument. (stop_all_threads): Use cleanup_function. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 9e3b1fb6ef..19c6289f8d 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4276,7 +4276,7 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws) /* A cleanup that disables thread create/exit events. */ static void -disable_thread_events (void *arg) +disable_thread_events () { target_thread_events (0); } @@ -4289,7 +4289,6 @@ stop_all_threads (void) /* We may need multiple passes to discover all threads. */ int pass; int iterations = 0; - struct cleanup *old_chain; gdb_assert (target_is_non_stop_p ()); @@ -4299,7 +4298,7 @@ stop_all_threads (void) scoped_restore_current_thread restore_thread; target_thread_events (1); - old_chain = make_cleanup (disable_thread_events, NULL); + cleanup_function defer_disable_events (disable_thread_events); /* Request threads to stop, and then wait for the stops. Because threads we already know about can spawn more threads while we're @@ -4484,8 +4483,6 @@ stop_all_threads (void) } } - do_cleanups (old_chain); - if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stop_all_threads done\n"); }