diff options
author | Luis Machado <luis.machado@linaro.org> | 2021-11-26 11:31:18 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2021-12-15 17:00:00 -0300 |
commit | 261b07488b9dfe69090e6980f6de9d0f4f3f03ca (patch) | |
tree | c962f1627fd0fa4daa203300f8fc2fc77fd0c47b /gdbsupport/common.m4 | |
parent | 4d3605c8ca92bcde848581a8ec031827c798501b (diff) | |
download | gdb-261b07488b9dfe69090e6980f6de9d0f4f3f03ca.zip gdb-261b07488b9dfe69090e6980f6de9d0f4f3f03ca.tar.gz gdb-261b07488b9dfe69090e6980f6de9d0f4f3f03ca.tar.bz2 |
New --enable-threading configure option to control use of threads in GDB/GDBserver
Add the --enable-threading configure option so multithreading can be disabled
at configure time. This is useful for statically-linked builds of
GDB/GDBserver, since the thread library doesn't play well with that setup.
If you try to run a statically-linked GDB built with threading, it will crash
when setting up the number of worker threads.
This new option is also convenient when debugging GDB in a system with lots of
threads, where the thread discovery code in GDB will emit too many messages,
like so:
[New Thread 0xfffff74d3a50 (LWP 2625599)]
If you have X threads, that message will be repeated X times.
The default for --enable-threading is "yes".
Diffstat (limited to 'gdbsupport/common.m4')
-rw-r--r-- | gdbsupport/common.m4 | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index 81e7c75..430d66b 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -76,6 +76,19 @@ AC_DEFUN([GDB_AC_COMMON], [ # Define HAVE_KINFO_GETFILE if kinfo_getfile is available. AC_CHECK_FUNCS(kinfo_getfile) + # ----------------------- # + # Check for threading. # + # ----------------------- # + + AC_ARG_ENABLE(threading, + AS_HELP_STRING([--enable-threading], [include support for parallel processing of data (yes/no)]), + [case "$enableval" in + yes) want_threading=yes ;; + no) want_threading=no ;; + *) AC_MSG_ERROR([bad value $enableval for threading]) ;; + esac], + [want_threading=yes]) + # Check for std::thread. This does not work on some platforms, like # mingw and DJGPP. AC_LANG_PUSH([C++]) @@ -101,9 +114,12 @@ AC_DEFUN([GDB_AC_COMMON], [ LIBS="$save_LIBS" CXXFLAGS="$save_CXXFLAGS" fi - if test "$gdb_cv_cxx_std_thread" = "yes"; then - AC_DEFINE(CXX_STD_THREAD, 1, - [Define to 1 if std::thread works.]) + + if test "$want_threading" = "yes"; then + if test "$gdb_cv_cxx_std_thread" = "yes"; then + AC_DEFINE(CXX_STD_THREAD, 1, + [Define to 1 if std::thread works.]) + fi fi AC_LANG_POP |