From: Andrew Burgess Date: Sat, 5 Oct 2024 11:34:14 +0000 (+0100) Subject: gdb: include --enable-targets in 'show configuration' output X-Git-Tag: gdb-16-branchpoint~702 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd5e87850f36882acaa3220207737b9ca136f3f9;p=thirdparty%2Fbinutils-gdb.git gdb: include --enable-targets in 'show configuration' output Include the value of configuration flag --enable-targets in the output of GDB command 'show configuration' and also in the output printed for 'gdb --configuration'. This will make it easier to see how GDB was built. No tests added or updated as we can't really check for a specific flag appearing or not appearing on the configuration output. But we do print the configuration within lib/gdb.exp to check which features are built into GDB, so if this change broke configuration printing then plenty of tests should stop working (they don't). Approved-By: Tom Tromey --- diff --git a/gdb/config.in b/gdb/config.in index 57be033802e..59a5da39553 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -46,6 +46,9 @@ language is requested. */ #undef ENABLE_NLS +/* Additional targets configured into GDB. */ +#undef ENABLE_TARGETS + /* The .gdbearlyinit filename. */ #undef GDBEARLYINIT diff --git a/gdb/configure b/gdb/configure index 53eaad4f0e2..ec9bbd3a842 100755 --- a/gdb/configure +++ b/gdb/configure @@ -24828,11 +24828,19 @@ if test "${enable_targets+set}" = set; then : yes | "") as_fn_error $? "enable-targets option must specify target names or 'all'" "$LINENO" 5 ;; no) enable_targets= ;; - *) enable_targets=$enableval ;; + *) + enable_targets=$enableval + +cat >>confdefs.h <<_ACEOF +#define ENABLE_TARGETS "$enable_targets" +_ACEOF + + ;; esac fi + # Check whether --enable-64-bit-bfd was given. if test "${enable_64_bit_bfd+set}" = set; then : enableval=$enable_64_bit_bfd; case $enableval in #( diff --git a/gdb/configure.ac b/gdb/configure.ac index 8368fea0423..21f5dc8dd30 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -184,9 +184,14 @@ AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]), yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all') ;; no) enable_targets= ;; - *) enable_targets=$enableval ;; + *) + enable_targets=$enableval + AC_DEFINE_UNQUOTED(ENABLE_TARGETS, "$enable_targets", + Additional targets configured into GDB. ) + ;; esac]) + BFD_64_BIT # Provide defaults for some variables set by the per-host and per-target diff --git a/gdb/top.c b/gdb/top.c index eae54aae1ff..d34e733eb0f 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1379,6 +1379,11 @@ This GDB was configured as follows:\n\ configure --host=%s --target=%s\n\ "), host_name, target_name); +#ifdef ENABLE_TARGETS + gdb_printf (stream, _("\ + --enable-targets=%s\n"), ENABLE_TARGETS); +#endif + gdb_printf (stream, _("\ --with-auto-load-dir=%s\n\ --with-auto-load-safe-path=%s\n\