]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
simulate-thread tests: Silence gdb debuginfod warning
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 4 Nov 2024 22:22:00 +0000 (06:22 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 4 Nov 2024 23:07:25 +0000 (07:07 +0800)
When gdb defaults to use debuginfod, gdb warns simulate-thread tests:

spawn gdb -nx -nw -batch -x /export/gnu/import/git/gitlab/x86-gcc/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb ./atomic-load-int.exe
Breakpoint 1 at 0x4005cc: file /export/gnu/import/git/gitlab/x86-gcc/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c, line 97.

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.

Silence gdb warning by setting DEBUGINFOD_URLS to "" and restore it if
it exists.

PR testsuite/117300
* g++.dg/simulate-thread/simulate-thread.exp: Set DEBUGINFOD_URLS
to "" and restore it if it exists.
* gcc.dg/simulate-thread/simulate-thread.exp: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp
gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp

index 35a111cfd1370d1ae4eb3fdc78a8cff1e20fa2e7..ad428c148ec0699df76d395dbc82f808073d3abf 100644 (file)
@@ -30,10 +30,19 @@ set-torture-options [list \
        { -O3 -g -std=c++11 } \
        { -Os -g } ]
 
+if [info exists ::env(DEBUGINFOD_URLS)] {
+  set orig_debuginfod_urls "$::env(DEBUGINFOD_URLS)"
+  setenv DEBUGINFOD_URLS ""
+}
+
 if [gdb-exists] {
   gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" ""
   gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/simulate-thread/*.c]] "" ""
 }
 
+if [info exists ::env(DEBUGINFOD_URLS)] {
+  setenv DEBUGINFOD_URLS "$orig_debuginfod_urls"
+}
+
 torture-finish
 dg-finish
index 8983cc766052346e42438417bd854e38f3134bd6..7a8178f5f67cee4717b9af2403e4010242939b3d 100644 (file)
@@ -32,10 +32,19 @@ set-torture-options [list \
        { -O2 -g } \
        { -O3 -g } ]
 
+if [info exists ::env(DEBUGINFOD_URLS)] {
+  set orig_debuginfod_urls "$::env(DEBUGINFOD_URLS)"
+  setenv DEBUGINFOD_URLS ""
+}
+
 if [gdb-exists] {
   gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" ""
   gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/simulate-thread/*.c]] "" ""
 }
 
+if [info exists ::env(DEBUGINFOD_URLS)] {
+  setenv DEBUGINFOD_URLS "$orig_debuginfod_urls"
+}
+
 torture-finish
 dg-finish