* [pushed 0/3] [gdb/testsuite] cc-with-gnu-debuglink fixes
@ 2026-10-20 7:01 Tom de Vries
2026-10-20 7:01 ` [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink Tom de Vries
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tom de Vries @ 2026-10-20 7:01 UTC (permalink / raw)
To: gdb-patches
This series contains three patches that improve handling of the
cc-with-gnu-debuglink target board.
Tested on x86_64-linux.
Tom de Vries (3):
[gdb/testsuite] Factor out have_gnu_debuglink
[gdb/testsuite] Use have_gnu_debuglink in two more test-cases
[gdb/testsuite] Skip debuginfod tests with cc-with-gnu-debuglink board
gdb/testsuite/gdb.base/dwz-symtabs.exp | 5 +----
gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp | 2 ++
gdb/testsuite/gdb.debuginfod/crc_mismatch.exp | 2 ++
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp | 2 ++
gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp | 5 +----
gdb/testsuite/gdb.debuginfod/solib-with-soname.exp | 6 ++----
.../gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp | 2 +-
gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp | 7 ++-----
gdb/testsuite/gdb.tui/debuginfod-query.exp | 5 +----
gdb/testsuite/lib/gdb.exp | 5 +++++
10 files changed, 19 insertions(+), 22 deletions(-)
base-commit: b89169e9d457c0e7ec8f88b7dfd102ca657a6e83
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink
2026-10-20 7:01 [pushed 0/3] [gdb/testsuite] cc-with-gnu-debuglink fixes Tom de Vries
@ 2026-10-20 7:01 ` Tom de Vries
2026-10-20 7:01 ` [pushed 2/3] [gdb/testsuite] Use have_gnu_debuglink in two more test-cases Tom de Vries
2026-10-20 7:01 ` [pushed 3/3] [gdb/testsuite] Skip debuginfod tests with cc-with-gnu-debuglink board Tom de Vries
2 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2026-10-20 7:01 UTC (permalink / raw)
To: gdb-patches
Factor out proc have_gnu_debuglink, and use it, mostly via require.
---
gdb/testsuite/gdb.base/dwz-symtabs.exp | 5 +----
gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp | 5 +----
.../gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp | 2 +-
gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp | 7 ++-----
gdb/testsuite/gdb.tui/debuginfod-query.exp | 5 +----
gdb/testsuite/lib/gdb.exp | 5 +++++
6 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/gdb/testsuite/gdb.base/dwz-symtabs.exp b/gdb/testsuite/gdb.base/dwz-symtabs.exp
index d695b272c9a..96fccc70df6 100644
--- a/gdb/testsuite/gdb.base/dwz-symtabs.exp
+++ b/gdb/testsuite/gdb.base/dwz-symtabs.exp
@@ -58,10 +58,7 @@ if {[build_executable "build libbar.so" $libbar_filename \
# adds a .gnu_debuglink, then this test isn't going to work. We want to be
# in control of splitting out the debug information, and we definitely don't
# want a .gnu_debuglink otherwise debuginfod isn't going to be needed.
-if {[section_get $libbar_filename ".gnu_debuglink"] ne ""} {
- unsupported "debug information has already been split out"
- return
-}
+require {!have_gnu_debuglink $libbar_filename}
# Compile libfoo.so.
if {[build_executable "build libfoo.so" $libfoo_filename \
diff --git a/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp b/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp
index 9808f6c3e87..caee4290c00 100644
--- a/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp
+++ b/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp
@@ -103,10 +103,7 @@ if {[build_executable "build libbar.so" $libbar_filename \
# adds a .gnu_debuglink, then this test isn't going to work. We want to be
# in control of splitting out the debug information, and we definitely don't
# want a .gnu_debuglink otherwise debuginfod isn't going to be needed.
-if {[section_get $libbar_filename ".gnu_debuglink"] ne ""} {
- unsupported "debug information has already been split out"
- return
-}
+require {!have_gnu_debuglink $libbar_filename}
# Compile libfoo.so.
if {[build_executable "build libfoo.so" $libfoo_filename \
diff --git a/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp b/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp
index 39a221a1b75..301a4325bc6 100644
--- a/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp
+++ b/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp
@@ -114,7 +114,7 @@ proc run_test { version } {
# The path reported in the complaint message is always
# absolute. Handle this with an optional prefix pattern.
set binfile_re "\[^\r\n\]*[string_to_regexp $host_binfile]"
- } elseif {[section_get $binfile_name ".gnu_debuglink"] ne ""} {
+ } elseif {[have_gnu_debuglink $binfile_name]} {
set binfile_re "\[^\r\n\]+[string_to_regexp ${testfile_name}.debug]"
} else {
set binfile_re [string_to_regexp $binfile_name]
diff --git a/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp b/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp
index 3bfc7b1156d..9fcccec265c 100644
--- a/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp
+++ b/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp
@@ -129,6 +129,8 @@ proc_with_prefix test_from_debuginfod_prompt {} {
return
}
+ require {!have_gnu_debuglink $::binfile}
+
set stripped_binfile [standard_output_file ${::testfile}-stripped]
file copy -force $::binfile $stripped_binfile
if {[gdb_gnu_strip_debug $stripped_binfile no-debuglink]} {
@@ -136,11 +138,6 @@ proc_with_prefix test_from_debuginfod_prompt {} {
return
}
- if {[section_get $stripped_binfile ".gnu_debuglink"] ne ""} {
- unsupported "debug information has already been split out"
- return
- }
-
save_vars { env(DEBUGINFOD_URLS) } {
setenv DEBUGINFOD_URLS "foo"
Term::clean_restart 24 80
diff --git a/gdb/testsuite/gdb.tui/debuginfod-query.exp b/gdb/testsuite/gdb.tui/debuginfod-query.exp
index 98d61850842..1f46ca05299 100644
--- a/gdb/testsuite/gdb.tui/debuginfod-query.exp
+++ b/gdb/testsuite/gdb.tui/debuginfod-query.exp
@@ -29,10 +29,7 @@ if { [build_executable "build executable" $testfile $srcfile] == -1 } {
return
}
-if {[section_get $binfile ".gnu_debuglink"] ne ""} {
- unsupported "debug information has already been split out"
- return
-}
+require {!have_gnu_debuglink $binfile}
# Assume that GDB is in TUI mode, in the SRC layout, and that a
# debuginfod prompt is currently active in the CMD window.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index dba696cc130..1aae8cad1ae 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -12335,6 +12335,11 @@ proc section_get {exec section} {
}
}
+# Return true if BINFILE has a .gnu_debuglink section.
+proc have_gnu_debuglink {binfile} {
+ return [expr {[section_get $binfile ".gnu_debuglink"] ne ""}]
+}
+
# Return true if we expect the build-id from FILENAME to be included
# in a core file.
#
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pushed 2/3] [gdb/testsuite] Use have_gnu_debuglink in two more test-cases
2026-10-20 7:01 [pushed 0/3] [gdb/testsuite] cc-with-gnu-debuglink fixes Tom de Vries
2026-10-20 7:01 ` [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink Tom de Vries
@ 2026-10-20 7:01 ` Tom de Vries
2026-10-20 7:01 ` [pushed 3/3] [gdb/testsuite] Skip debuginfod tests with cc-with-gnu-debuglink board Tom de Vries
2 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2026-10-20 7:01 UTC (permalink / raw)
To: gdb-patches
When running test-cases gdb.debuginfod/crc_mismatch.exp and
gdb.debuginfod/solib-with-soname.exp with target board cc-with-gnu-debuglink,
we get:
...
UNSUPPORTED: gdb.debuginfod/crc_mismatch.exp: \
cannot produce separate debug info files
UNSUPPORTED: gdb.debuginfod/solib-with-soname.exp: \
debug information has been split to a separate file
...
Use proc have_gnu_debuglink to get the more precise:
...
UNSUPPORTED: gdb.debuginfod/crc_mismatch.exp: \
require failed: !have_gnu_debuglink $binfile
UNSUPPORTED: gdb.debuginfod/solib-with-soname.exp: \
require failed: !have_gnu_debuglink $binfile
...
---
gdb/testsuite/gdb.debuginfod/crc_mismatch.exp | 2 ++
gdb/testsuite/gdb.debuginfod/solib-with-soname.exp | 6 ++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp b/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp
index 35f91bff261..9bf65c4e0e6 100644
--- a/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp
+++ b/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp
@@ -31,6 +31,8 @@ if {[build_executable "build executable" $testfile $srcfile debug] == -1} {
return
}
+require {!have_gnu_debuglink $binfile}
+
# The procedure gdb_gnu_strip_debug will produce an executable called
# ${binfile}, which is just like the executable ($binfile) but without
# the debuginfo. Instead $binfile has a .gnu_debuglink section which
diff --git a/gdb/testsuite/gdb.debuginfod/solib-with-soname.exp b/gdb/testsuite/gdb.debuginfod/solib-with-soname.exp
index 12f0011d457..af6d548c37d 100644
--- a/gdb/testsuite/gdb.debuginfod/solib-with-soname.exp
+++ b/gdb/testsuite/gdb.debuginfod/solib-with-soname.exp
@@ -103,16 +103,14 @@ require {expect_build_id_in_core_file $binfile}
# If the board file is automatically splitting the debug information
# into a separate file (e.g. the cc-with-gnu-debuglink.exp board) then
# this test isn't going to work.
+require {!have_gnu_debuglink $binfile}
+
clean_restart
gdb_file_cmd $binfile
if {$gdb_file_cmd_debug_info ne "debug"} {
unsupported "failed to find debug information"
return
}
-if {[regexp "${testfile}.debug" $gdb_file_cmd_msg]} {
- unsupported "debug information has been split to a separate file"
- return
-}
# Run BINFILE which will generate a corefile.
set corefile [core_find $binfile]
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pushed 3/3] [gdb/testsuite] Skip debuginfod tests with cc-with-gnu-debuglink board
2026-10-20 7:01 [pushed 0/3] [gdb/testsuite] cc-with-gnu-debuglink fixes Tom de Vries
2026-10-20 7:01 ` [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink Tom de Vries
2026-10-20 7:01 ` [pushed 2/3] [gdb/testsuite] Use have_gnu_debuglink in two more test-cases Tom de Vries
@ 2026-10-20 7:01 ` Tom de Vries
2 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2026-10-20 7:01 UTC (permalink / raw)
To: gdb-patches
With test-case gdb.debuginfod/fetch_src_and_symbols.exp and target board
cc-with-gnu-debuglink, we run into:
...
output is objcopy: fetch_src_and_symbols.stripped: \
debuglink section already exists
FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: no_url: strip debuginfo
ERROR: tcl error sourcing gdb.debuginfod/fetch_src_and_symbols.exp.
ERROR: tcl error code TCL READ VARNAME
ERROR: can't read "debugdir": no such variable
...
In the test-case, the plan is to use gdb_gnu_strip_debug to move the debuginfo
from $binfile to a .debug file, and move it into $debugdir, where debuginfod
will find it.
If we run with target board cc-with-gnu-debuglink, $binfile already doesn't
have any debuginfo anymore, but a .gnu_debuglink pointing to a .debug file in
a .debug dir. Consequently, gdb_gnu_strip_debug will fail.
We could try to detect this situation and somehow make it work, but it
doesn't seem to be worth the trouble. The .gnu_debuglink case is tested by
default by this test-case, so there's no need to test it when using the
board.
Fix this by requiring !have_gnu_debuglink.
Likewise in gdb.debuginfod/build-id-no-debug-warning.exp.
---
gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp | 2 ++
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp | 2 ++
2 files changed, 4 insertions(+)
diff --git a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp
index eae60901329..362686c87a4 100644
--- a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp
+++ b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp
@@ -30,6 +30,8 @@ if {[build_executable "build executable" ${testfile} ${srcfile} \
return
}
+require {!have_gnu_debuglink $binfile}
+
# Split debug information from BINFILE into BINFILE.debug.
#
# By passing the "no-debuglink" flag we prevent this proc from adding
diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
index e7c2f524abe..518f9d32a94 100644
--- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
+++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
@@ -37,6 +37,8 @@ if { [gdb_compile "$sourcetmp" "$binfile" executable {debug build-id}] != "" } {
return
}
+require {!have_gnu_debuglink $binfile}
+
if { [gdb_compile "$sourcetmp" "${binfile}2" executable {debug build-id}] != "" } {
fail "compile"
return
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-20 7:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 7:01 [pushed 0/3] [gdb/testsuite] cc-with-gnu-debuglink fixes Tom de Vries
2026-10-20 7:01 ` [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink Tom de Vries
2026-10-20 7:01 ` [pushed 2/3] [gdb/testsuite] Use have_gnu_debuglink in two more test-cases Tom de Vries
2026-10-20 7:01 ` [pushed 3/3] [gdb/testsuite] Skip debuginfod tests with cc-with-gnu-debuglink board Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox