aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog12
-rw-r--r--gdb/gdbserver/acinclude.m43
-rwxr-xr-xgdb/gdbserver/configure29
-rw-r--r--gdb/gdbserver/configure.ac6
-rw-r--r--gdb/gdbserver/configure.srv2
-rw-r--r--gdb/gdbserver/server.c2
6 files changed, 46 insertions, 8 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index da4c24f..27f7ab5 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,15 @@
+2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
+ Simon Marchi <simark@simark.ca>
+
+ * acinclude.m4: Include "../selftest.m4".
+ * configure: Regenerate.
+ * configure.ac: Use "GDB_AC_SELFTEST".
+ * configure.srv: Use "$enable_unittests" instead of
+ "$development" when checking whether unit tests have been
+ enabled.
+ * server.c (captured_main): Update message informing that
+ selftests have been disabled.
+
2018-10-04 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4
index c75d783..fc3e344 100644
--- a/gdb/gdbserver/acinclude.m4
+++ b/gdb/gdbserver/acinclude.m4
@@ -31,6 +31,9 @@ m4_include(../ptrace.m4)
m4_include(../ax_cxx_compile_stdcxx.m4)
+dnl For GDB_AC_SELFTEST.
+m4_include(../selftest.m4)
+
dnl Check for existence of a type $1 in libthread_db.h
dnl Based on BFD_HAVE_SYS_PROCFS_TYPE in bfd/bfd.m4.
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index a46b865..1ddbd6b 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -722,6 +722,7 @@ enable_option_checking
enable_maintainer_mode
enable_largefile
enable_libmcheck
+enable_unit_tests
with_ust
with_ust_include
with_ust_lib
@@ -1367,6 +1368,8 @@ Optional Features:
sometimes confusing) to the casual installer
--disable-largefile omit support for large files
--enable-libmcheck Try linking with -lmcheck if available
+ --enable-unit-tests Enable the inclusion of unit tests when compiling
+ GDB
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings if gcc is used
--enable-gdb-build-warnings
@@ -5889,13 +5892,35 @@ fi
fi
-if $development; then
- srv_selftest_objs="common/selftest.o"
+
+# Check whether we will enable the inclusion of unit tests when
+# compiling GDB.
+#
+# The default value of this option changes depending whether we're on
+# development mode (in which case it's "true") or not (in which case
+# it's "false").
+# Check whether --enable-unit-tests was given.
+if test "${enable_unit_tests+set}" = set; then :
+ enableval=$enable_unit_tests; case "${enableval}" in
+ yes) enable_unittests=true ;;
+ no) enable_unittests=false ;;
+ *) as_fn_error $? "bad value ${enableval} for --{enable,disable}-unit-tests option" "$LINENO" 5 ;;
+esac
+else
+ enable_unittests=$development
+fi
+
+
+if $enable_unittests; then
$as_echo "#define GDB_SELF_TEST 1" >>confdefs.h
+
+ srv_selftest_objs="common/selftest.o"
+
fi
+
case ${build_alias} in
"") build_noncanonical=${build} ;;
*) build_noncanonical=${build_alias} ;;
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index fa3ca53..f1dfa45 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -54,11 +54,9 @@ else
fi
GDB_AC_LIBMCHECK(${libmcheck_default})
-if $development; then
+GDB_AC_SELFTEST([
srv_selftest_objs="common/selftest.o"
- AC_DEFINE(GDB_SELF_TEST, 1,
- [Define if self-testing features should be enabled])
-fi
+])
ACX_NONCANONICAL_TARGET
ACX_NONCANONICAL_HOST
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 72e6a0d..636d830 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -24,7 +24,7 @@
# Default hostio_last_error implementation
srv_hostio_err_objs="hostio-errno.o"
-if $development; then
+if $enable_unittests; then
srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-avx-avx512-linux.o i386-avx-mpx-avx512-pku-linux.o i386-mpx-linux.o i386-avx-mpx-linux.o i386-mmx-linux.o linux-x86-tdesc-selftest.o"
srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o amd64-avx-avx512-linux.o amd64-avx-mpx-avx512-pku-linux.o amd64-mpx-linux.o amd64-avx-mpx-linux.o x32-linux.o x32-avx-linux.o x32-avx-avx512-linux.o"
else
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index d711c53..4ec3548 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -3790,7 +3790,7 @@ captured_main (int argc, char *argv[])
#if GDB_SELF_TEST
selftests::run_tests (selftest_filter);
#else
- printf (_("Selftests are not available in a non-development build.\n"));
+ printf (_("Selftests have been disabled for this build.\n"));
#endif
throw_quit ("Quit");
}