From 8ae4a838bc0f5796369d982330acacf7a8fa7eab Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 5 Nov 2024 06:22:00 +0800 Subject: [PATCH] simulate-thread tests: Silence gdb debuginfod warning 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: 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 --- gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp | 9 +++++++++ gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp b/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp index 35a111cfd13..ad428c148ec 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp +++ b/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp @@ -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 diff --git a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp index 8983cc76605..7a8178f5f67 100644 --- a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp +++ b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp @@ -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