public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lancelot.six@amd.com>
To: <gdb-patches@sourceware.org>
Cc: <lsix@lancelotsix.com>, Lancelot SIX <lancelot.six@amd.com>
Subject: [PATCH 1/4] gdb: 'show config' shows --with[out]-amd-dbgapi
Date: Tue, 7 Feb 2023 13:27:59 +0000	[thread overview]
Message-ID: <20230207132802.223510-2-lancelot.six@amd.com> (raw)
In-Reply-To: <20230207132802.223510-1-lancelot.six@amd.com>

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.
---
 gdb/config.in    |  3 +++
 gdb/configure    |  3 +++
 gdb/configure.ac |  1 +
 gdb/top.c        | 10 ++++++++++
 4 files changed, 17 insertions(+)

diff --git a/gdb/config.in b/gdb/config.in
index 7da131ebf04..a6027847444 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -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
 
diff --git a/gdb/configure b/gdb/configure
index 113b7cf8a30..8b2039912e7 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -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
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 7c7bf88b3fb..79eb013ce19 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -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
diff --git a/gdb/top.c b/gdb/top.c
index 205eb360ba3..2447ba55bca 100644
--- 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-dbapi\n\
+"));
+#endif
+
 #if HAVE_SOURCE_HIGHLIGHT
   gdb_printf (stream, _("\
 	     --enable-source-highlight\n\
-- 
2.34.1


  reply	other threads:[~2023-02-07 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 13:27 [PATCH 0/4] Fix gdb.rocm/simple.exp on hosts without ROCm Lancelot SIX
2023-02-07 13:27 ` Lancelot SIX [this message]
2023-02-07 13:28 ` [PATCH 2/4] gdb/testsuite: Rename skip_hipcc_tests to allow_hipcc_tests Lancelot SIX
2023-02-07 13:28 ` [PATCH 3/4] gdb/testsuite: require amd-dbgapi support to run rocm tests Lancelot SIX
2023-02-07 13:59   ` Simon Marchi
2023-02-07 13:28 ` [PATCH 4/4] gdb/testsuite: allow_hipcc_tests tests the hipcc compiler Lancelot SIX
2023-02-07 13:42   ` Lancelot SIX
2023-02-07 14:12   ` Simon Marchi
2023-02-07 15:31     ` Lancelot SIX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230207132802.223510-2-lancelot.six@amd.com \
    --to=lancelot.six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).