]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Pass INTERNAL_GDBFLAGS when executing GDB
authorKeith Seitz <keiths@redhat.com>
Wed, 17 Jun 2020 15:21:30 +0000 (08:21 -0700)
committerKeith Seitz <keiths@redhat.com>
Wed, 17 Jun 2020 17:44:59 +0000 (10:44 -0700)
gdb.debuginfod/fetch_src_and_symbols.exp attempts to ascertain
whether GDB was built with debuginfod support by executing
"$GDB --configuration".

That seems harmless enough. However, if GDB is not already installed
on the host, the command will fail:

$ ./gdb --config
Exception caught while booting Guile.
Error in function "open-file":
No such file or directory: "/usr/share/gdb/guile/gdb/boot.scm"
./gdb: warning: Could not complete Guile gdb module initialization from:
/usr/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.
Python Exception <class 'ModuleNotFoundError'> No module named 'gdb':
./gdb: warning:
Could not load the Python gdb module from `/usr/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
This GDB was configured as follows:
   configure --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu
      [abbreviated output]

The problem here is, of course, that while running in the test suite,
we must pass INTERNAL_GDBFLAGS in order to pick up the --data-directory
option.

gdb/testsuite/ChangeLog
2020-06-17  Keith Seitz  <keiths@redhat.com>

* gdb.deuginfod/fetch_src_and_symbols.exp: Pass INTERNAL_GDBFLAGS
when executing "gdb --configuration".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp

index d0101258b2ed34614ee5352c7e87c9ca4d8d928d..19cb2f1d7cb1c28e11fc90e109c77dbd99ab2831 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-17  Keith Seitz  <keiths@redhat.com>
+
+       * gdb.deuginfod/fetch_src_and_symbols.exp: Pass INTERNAL_GDBFLAGS
+       when executing "gdb --configuration".
+
 2020-06-17  Tom de Vries  <tdevries@suse.de>
 
        * lib/gdb.exp (gdb_tcl_unknown): New proc.
index 0bf18f2d124d8facc500416098c5f478cbdcff4d..fbab3b1f48d5cbfedf0393282d6b5466328d68e9 100644 (file)
@@ -30,7 +30,8 @@ if { [which curl] == 0 } {
 }
 
 # Skip testing if gdb was not configured with debuginfod
-if { [string first "with-debuginfod" [exec $GDB --configuration]] == -1 } {
+if { [string first "with-debuginfod" \
+         [eval exec $GDB $INTERNAL_GDBFLAGS --configuration]] == -1 } {
     untested "gdb not configured with debuginfod"
     return -1
 }