From patchwork Sat May 18 21:00:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32753 Received: (qmail 64179 invoked by alias); 18 May 2019 21:00:34 -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 60801 invoked by uid 89); 18 May 2019 21:00:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=AWL, 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.1 spammy=HX-Languages-Length:2578 X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.61.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 May 2019 21:00:24 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A1C76400ED3A0 for ; Sat, 18 May 2019 16:00:15 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id S6RDh6yHqdnCeS6RDhnnRQ; Sat, 18 May 2019 16:00:15 -0500 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=73zqT58Udwqk37LtGkY2uKoCnjrEtlpvht5mOSes5OA=; b=mkqwTECNSnwfpWkLgft0DNuSGy 0HCJEp5pNXeoB3LPjw9O0qvBHaBoLA7M5U4jYTL0uIPkcQKotoF4BYXp7NjJdRlkwjzAemqbfFPF9 HbLOSZkfaQUA0VDHrp60K/nnQ; Received: from 71-218-69-43.hlrn.qwest.net ([71.218.69.43]:38158 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hS6RD-0016Ya-E6; Sat, 18 May 2019 16:00:15 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 8/8] Add maint set/show enable-threads Date: Sat, 18 May 2019 15:00:10 -0600 Message-Id: <20190518210010.27697-9-tom@tromey.com> In-Reply-To: <20190518210010.27697-1-tom@tromey.com> References: <20190518210010.27697-1-tom@tromey.com> This adds maint commands to control whether gdb is able to use threads. gdb/ChangeLog 2019-05-18 Tom Tromey * NEWS: Add entry. * maint.c (_initialize_maint_cmds): Add "enable-threads" maint commands. gdb/doc/ChangeLog 2019-05-18 Tom Tromey * gdb.texinfo (Maintenance Commands): Document new maint commands. --- gdb/ChangeLog | 6 ++++++ gdb/NEWS | 4 ++++ gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 11 +++++++++++ gdb/maint.c | 10 ++++++++++ 5 files changed, 36 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index 1e92a2b52c2..dc278b5ee68 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -46,6 +46,10 @@ show print max-depth The default max-depth is 20, but this can be set to unlimited to get the old behavior back. +maint set enable-threads +maint show enable-threads + Control whether GDB can use threads. The default is "on". + * New MI commands -complete diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 37e2f14ad0f..7e34cd3179c 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -36925,6 +36925,17 @@ with the DWARF frame unwinders enabled. If DWARF frame unwinders are not supported for a particular target architecture, then enabling this flag does not cause them to be used. + +@kindex maint set enable-threads +@kindex maint show enable-threads +@item maint set enable-threads +@item maint show enable-threads +Control whether @value{GDBN} uses threads. On capable hosts, +@value{GDBN} will use multiple threads to speed up certain operations. +However, when debugging @value{GDBN} itself, it is sometimes +convenient to disable this feature. That can be done using this +command. The default is @samp{on}. + @kindex maint set profile @kindex maint show profile @cindex profiling GDB diff --git a/gdb/maint.c b/gdb/maint.c index 328d6026a34..0368eff338b 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -39,6 +39,7 @@ #include "top.h" #include "maint.h" #include "common/selftest.h" +#include "common/parallel-for.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" @@ -1143,4 +1144,13 @@ When enabled GDB is profiled."), show_maintenance_profile_p, &maintenance_set_cmdlist, &maintenance_show_cmdlist); + + add_setshow_boolean_cmd ("enable-threads", class_maintenance, + &gdb::enable_threads, _("\ +Set whether gdb can use multiple threads."), _("\ +Show whether gdb can use multiple threads."), _("\ +If enabled, gdb will use multiple threads when possible."), + NULL, NULL, + &maintenance_set_cmdlist, + &maintenance_show_cmdlist); }