gdb: 'show config' shows --with[out]-amd-dbgapi
authorLancelot SIX <lancelot.six@amd.com>
Mon, 6 Feb 2023 19:16:14 +0000 (19:16 +0000)
committerLancelot SIX <lancelot.six@amd.com>
Mon, 13 Feb 2023 09:42:13 +0000 (09:42 +0000)
Ensure that the "show configuration" command and the "--configuration"
command line switch shows if GDB was built with the AMDGPU support or
not.

This will be used in a later patch in this series.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/top.c

index 7da131ebf04ef16ad6009bc486e576141bfd9021..a60278474443b8f81f34bd38aeb1e8e440e54527 100644 (file)
@@ -84,6 +84,9 @@
    */
 #undef HAVE_ALLOCA_H
 
+/* Define if amd-dbgapi is being linked in. */
+#undef HAVE_AMD_DBGAPI
+
 /* Define to 1 if you have the `btowc' function. */
 #undef HAVE_BTOWC
 
index 113b7cf8a30967c66acca4b90bab6a7955ffa0bf..8b2039912e74773fc61b3031feeceef5b9f0899a 100755 (executable)
@@ -18252,6 +18252,9 @@ $as_echo "yes" >&6; }
 fi
 
   if test "$has_amd_dbgapi" = "yes"; then
+
+$as_echo "#define HAVE_AMD_DBGAPI 1" >>confdefs.h
+
     TARGET_OBS="$TARGET_OBS amd-dbgapi-target.o"
 
     # If --enable-targets=all was provided, use the list of all files depending
index 7c7bf88b3fbaea2a6fbc27f0900ac04d548dce4c..79eb013ce19108faf1566af9798419ad179b87cc 100644 (file)
@@ -275,6 +275,7 @@ if test "$gdb_require_amd_dbgapi" = true \
                    [has_amd_dbgapi=yes], [has_amd_dbgapi=no])
 
   if test "$has_amd_dbgapi" = "yes"; then
+    AC_DEFINE(HAVE_AMD_DBGAPI, 1, [Define if amd-dbgapi is being linked in.])
     TARGET_OBS="$TARGET_OBS amd-dbgapi-target.o"
 
     # If --enable-targets=all was provided, use the list of all files depending
index 205eb360ba36df3215f422986dcd916fe64fb921..1b189d7c5abca76157fc52ddce3dd9906260ae83 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1629,6 +1629,16 @@ This GDB was configured as follows:\n\
 "));
 #endif
 
+#if HAVE_AMD_DBGAPI
+  gdb_printf (stream, _("\
+            --with-amd-dbgapi\n\
+"));
+#else
+  gdb_printf (stream, _("\
+            --without-amd-dbgapi\n\
+"));
+#endif
+
 #if HAVE_SOURCE_HIGHLIGHT
   gdb_printf (stream, _("\
             --enable-source-highlight\n\