]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb.debuginfod/fetch_src_and_symbols.exp: fix when GDB is built with AddressSanitizer
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 2 Nov 2021 19:05:39 +0000 (15:05 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 9 Nov 2021 16:15:40 +0000 (11:15 -0500)
This test fails for me, showing:

    ERROR: tcl error sourcing /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp.
    ERROR: This GDB was configured as follows:
       configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
                 --with-auto-load-dir=$debugdir:$datadir/auto-load
                 --with-auto-load-safe-path=$debugdir:$datadir/auto-load
    ... and much more ...

The problem is that TCL's exec throws an error as soon as the exec'ed
process outputs on stderr.  When GDB is built with ASan, it prints some
warnings about pre-existing signal handlers:

    warning: Found custom handler for signal 7 (Bus error) preinstalled.
    warning: Found custom handler for signal 8 (Floating point exception) preinstalled.
    warning: Found custom handler for signal 11 (Segmentation fault) preinstalled.

Pass --quiet to GDB to avoid these warnings.

Change-Id: I3751d89b9b1df646da19149d7cb86775e2d3e80f

gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp

index 92f3cd8b01dd6f7a0aca9de4d46c09c040a5ff8f..31e9e4a92f0c37039a62957162c74498443cf0c5 100644 (file)
@@ -30,8 +30,13 @@ if { [which curl] == 0 } {
 }
 
 # Skip testing if gdb was not configured with debuginfod
+#
+# If GDB is built with ASan, it warns that some signal handlers (installed by
+# ASan) exist on startup.  That makes TCL's exec throw an error.  Disable that
+# by passing --quiet.
+
 if { [string first "with-debuginfod" \
-        [eval exec $GDB $INTERNAL_GDBFLAGS --configuration]] == -1 } {
+        [eval exec $GDB --quiet $INTERNAL_GDBFLAGS --configuration]] == -1 } {
     untested "gdb not configured with debuginfod"
     return -1
 }