[binutils-gdb] [gdb/python] Only include gdbsupport/selftest.h if GDB_SELF_TEST

Tom de Vries vries@sourceware.org
Mon Oct 23 16:24:31 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=093c25c488ad6826d29d9345422c7845658ef383

commit 093c25c488ad6826d29d9345422c7845658ef383
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Oct 23 18:25:12 2023 +0200

    [gdb/python] Only include gdbsupport/selftest.h if GDB_SELF_TEST
    
    I noticed that gdb/python/python.c unconditionally includes
    gdbsupport/selftest.h.
    
    Make this conditional on GDB_SELF_TEST.
    
    Tested on x86_64-linux.

Diff:
---
 gdb/python/python.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/python/python.c b/gdb/python/python.c
index d3dea088c3b..d569fb5a3e4 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -35,9 +35,12 @@
 #include <ctype.h>
 #include "location.h"
 #include "run-on-main-thread.h"
-#include "gdbsupport/selftest.h"
 #include "observable.h"
 
+#if GDB_SELF_TEST
+#include "gdbsupport/selftest.h"
+#endif
+
 /* Declared constants and enum for python stack printing.  */
 static const char python_excp_none[] = "none";
 static const char python_excp_full[] = "full";


More information about the Gdb-cvs mailing list