]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add maint set/show max-worker-threads
authorTom Tromey <tom@tromey.com>
Sat, 16 Mar 2019 20:36:57 +0000 (14:36 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 1 Oct 2019 19:38:26 +0000 (13:38 -0600)
This adds maint commands to control the maximum number of worker
threads that gdb can use.

2019-09-30  Tom Tromey  <tom@tromey.com>

* NEWS: Add entry.
* maint.c (_initialize_maint_cmds): Add "max-worker-threads" maint
commands.

gdb/doc/ChangeLog
2019-09-30  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Maintenance Commands): Document new maint
commands.

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/maint.c

index e2b91c613ba3071d1329ff06dcd2881fe5b4e8ef..d7407a3292e662b9c13ed317484659160f580059 100644 (file)
@@ -1,3 +1,9 @@
+2019-09-30  Tom Tromey  <tom@tromey.com>
+
+       * NEWS: Add entry.
+       * maint.c (_initialize_maint_cmds): Add "max-worker-threads" maint
+       commands.
+
 2019-09-30  Tom Tromey  <tom@tromey.com>
 
        * minsyms.c (minimal_symbol_reader::install): Use
index 779fd91d3a62bfea16f51c2ac2bcf8a6583395cc..7d4988f6cb0a6f5f468e294bf1768c773f45037a 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -122,6 +122,12 @@ set style highlight background COLOR
 set style highlight intensity VALUE
   Control the styling of highlightings.
 
+maint set max-worker-threads
+maint show max-worker-threads
+  Control the maximum number of worker threads that can be used by GDB.
+  The default is "unlimited".  Currently worker threads are only used when
+  demangling the names of linker symbols.
+
 maint set test-settings KIND
 maint show test-settings KIND
   A set of commands used by the testsuite for exercising the settings
index 0a10fa3fade7b0d911b1188e954a8c64e8cf557d..eef81f0937294cf8b28c585ae12084fd1b7d86cf 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-30  Tom Tromey  <tom@tromey.com>
+
+       * gdb.texinfo (Maintenance Commands): Document new maint
+       commands.
+
 2019-09-20  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * doc/gdb.texinfo (Remote Configuration): Remove documentation for
index f2713c03960dbe3bf4cc15714fc2bd68794db26e..04a40091de4f1855aefdfe87cc513bfe4af257c4 100644 (file)
@@ -37663,6 +37663,20 @@ 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 max-worker-threads
+@kindex maint show max-worker-threads
+@item maint set max-worker-threads
+@item maint show max-worker-threads
+Control the number of worker threads that may be used by @value{GDBN}.
+On capable hosts, @value{GDBN} may use multiple threads to speed up
+certain CPU-intensive operations, such as demangling symbol names.
+While the number of threads used by @value{GDBN} may vary, this
+command can be used to set an upper bound on this number.  The default
+is @code{unlimited}.  Note that this only controls worker threads
+started by @value{GDBN} itself; libraries used by @value{GDBN} may
+start threads of their own.
+
 @kindex maint set profile
 @kindex maint show profile
 @cindex profiling GDB
index ec9f4abb26466936c76fc9bc0cef8a1091e616c9..8428bea4f92f579c9fb1e7f05d20dc9a0cd86e7e 100644 (file)
@@ -40,6 +40,7 @@
 #include "top.h"
 #include "maint.h"
 #include "gdbsupport/selftest.h"
+#include "gdbsupport/parallel-for.h"
 
 #include "cli/cli-decode.h"
 #include "cli/cli-utils.h"
@@ -1312,4 +1313,15 @@ When enabled GDB is profiled."),
                           show_maintenance_profile_p,
                           &maintenance_set_cmdlist,
                           &maintenance_show_cmdlist);
+
+  add_setshow_zuinteger_unlimited_cmd ("max-worker-threads",
+                                      class_maintenance,
+                                      &gdb::max_threads, _("\
+Set the maximum number of worker threads GDB can use."), _("\
+Set the maximum number of worker threads GDB can use."), _("\
+GDB may use multiple threads to speed up certain CPU-intensive operations,\n\
+such as demangling symbol names."),
+                                      NULL, NULL,
+                                      &maintenance_set_cmdlist,
+                                      &maintenance_show_cmdlist);
 }