]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix GDB build in infrun.c when configured with unit tests disabled gdb-10-branchpoint
authorJoel Brobecker <brobecker@adacore.com>
Sat, 12 Sep 2020 19:30:56 +0000 (12:30 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Sat, 12 Sep 2020 19:38:35 +0000 (12:38 -0700)
I noticed this while testing the GDB in the context of the upcoming
GDB 10 release branching, because part of the process involves setting
development to False, which in turn changes the default for including
unittest to false as well. As a result, without this patch, we get
compilation errors in infrun.c such as:

    infrun.c:9219:5: error: `scoped_mock_context' was not declared in this scope

This patch fixes it by bracketing the unitttest in namespace selftest
with an #if GDB_SELF_TEST.

gdb/ChangeLog:

        * infrun.c (namespace selftests): Only define #if GDB_SELF_TEST.

Tested on x86_64-linux, with and without self-tests.

gdb/ChangeLog
gdb/infrun.c

index 6b1563a111ed3ae41dc3aac2ea03e17574e5997d..ec0ed5f1b2341deffd03efdab6d64e4e1754c95b 100644 (file)
@@ -1,3 +1,7 @@
+2020-09-12  Joel Brobecker  <brobecker@adacore.com>
+
+       * infrun.c (namespace selftests): Only define #if GDB_SELF_TEST.
+
 2020-09-11  Moritz Riesterer  <moritz.riesterer@intel.com>
            Felix Willgerodt  <Felix.Willgerodt@intel.com>
 
index 82ec30086a96dc4fb5d1ce1031595e578ddf11d0..5773fd0395153f183cecf2c197930802351e6890 100644 (file)
@@ -9200,6 +9200,7 @@ infrun_async_inferior_event_handler (gdb_client_data data)
   inferior_event_handler (INF_REG_EVENT);
 }
 
+#if GDB_SELF_TEST
 namespace selftests
 {
 
@@ -9264,6 +9265,8 @@ infrun_thread_ptid_changed ()
 
 } /* namespace selftests */
 
+#endif /* GDB_SELF_TEST */
+
 void _initialize_infrun ();
 void
 _initialize_infrun ()