From patchwork Wed Jan 23 15:21:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 31190 Received: (qmail 66013 invoked by alias); 23 Jan 2019 15:21:51 -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 65848 invoked by uid 89); 23 Jan 2019 15:21:50 -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, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Request X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jan 2019 15:21:49 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33E2A19CF6C; Wed, 23 Jan 2019 15:21:48 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D435672E6; Wed, 23 Jan 2019 15:21:47 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey , Andrew Burgess Subject: [PATCH v3 13/17] Remove cleanup from stop_all_threads Date: Wed, 23 Jan 2019 15:21:27 +0000 Message-Id: <20190123152131.29893-14-palves@redhat.com> In-Reply-To: <20190123152131.29893-1-palves@redhat.com> References: <20190123152131.29893-1-palves@redhat.com> From: Tom Tromey This removes the cleanup from stop_all_threads, replacing it with a scope_exit. gdb/ChangeLog yyyy-mm-dd Tom Tromey Pedro Alves * infrun.c (disable_thread_events): Delete. (stop_all_threads): Use SCOPE_EXIT. --- gdb/infrun.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 76dedd272a..d954eae6ed 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4273,14 +4273,6 @@ 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) -{ - target_thread_events (0); -} - /* See infrun.h. */ void @@ -4289,7 +4281,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 +4290,7 @@ stop_all_threads (void) scoped_restore_current_thread restore_thread; target_thread_events (1); - old_chain = make_cleanup (disable_thread_events, NULL); + SCOPE_EXIT { target_thread_events (0); }; /* 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 +4475,6 @@ stop_all_threads (void) } } - do_cleanups (old_chain); - if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stop_all_threads done\n"); }