Test-case gdb.base/solib-corrupted.exp only works for a glibc without probes
interface, otherwise we run into:
...
XFAIL: gdb.base/solib-corrupted.exp: info probes
UNTESTED: gdb.base/solib-corrupted.exp: GDB is using probes
...
Fix this by using maint ignore-probes to simulate the absence of the relevant
probes.
Also, it requires glibc debuginfo, and if not present, it produces an XFAIL:
...
XFAIL: gdb.base/solib-corrupted.exp: make solibs looping
UNTESTED: gdb.base/solib-corrupted.exp: no _r_debug symbol has been found
...
This is incorrect, because an XFAIL indicates a known problem in the
environment. In this case, there is no problem: the environment is
functioning as expected when glibc debuginfo is not installed.
Fix this by using UNSUPPORTED instead, and make the message less cryptic:
...
UNSUPPORTED: gdb.base/solib-corrupted.exp: make solibs looping \
(glibc debuginfo required)
...
Finally, with glibc debuginfo present, we run into:
...
(gdb) PASS: gdb.base/solib-corrupted.exp: make solibs looping
info sharedlibrary^M
warning: Corrupted shared library list: 0x7ffff7ffe750 != 0x0^M
From To Syms Read Shared Object Library^M
0x00007ffff7dd4170 0x00007ffff7df4090 Yes /lib64/ld-linux-x86-64.so.2^M
(gdb) FAIL: gdb.base/solib-corrupted.exp: corrupted list \
(shared library list corrupted)
...
due to commit
44288716537 ("gdb, testsuite: extend gdb_test_multiple checks").
Fix this by rewriting into gdb_test_multiple and using -early.
Tested on x86_64-linux, with and without glibc debuginfo installed.
return -1
}
+# With probes interface GDB no longer scans the inferior library list so its
+# corruption cannot be tested. Disable the probes interface.
+gdb_test "maint ignore-probes rtld"
+
if ![runto_main] {
return
}
-# With probes interface GDB no longer scans the inferior library list so its
-# corruption cannot be tested. There is no way to disable the probes
-# interface.
-
set probes { init_start init_complete map_start reloc_complete unmap_start
unmap_complete }
set test "info probes"
-re "^$gdb_prompt $" {
}
}
-if { [llength $probes] == 0 } {
- xfail $test
- untested "GDB is using probes"
- return
-}
+gdb_assert {[llength $probes] == 6} "no probes found"
gdb_test "info sharedlibrary" "From * To .*" "normal list"
-re "$no_glibc_debuginfo_re\r\n$gdb_prompt $" {
# glibc debug info is not available and it is too difficult to find and
# parse it from this testcase without the gdb supporting functions.
- xfail $test
- untested "no _r_debug symbol has been found"
+ unsupported "$gdb_test_name (glibc debuginfo required)"
return
}
-re " = 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
pass $test
}
}
-gdb_test "info sharedlibrary" "warning: Corrupted shared library list: .*" "corrupted list"
+
+# Use -early to prevent the default handling of the warning in gdb_test_multiple
+# from triggering.
+gdb_test_multiple "info sharedlibrary" "corrupted list" {
+ -early -re -wrap "warning: Corrupted shared library list: .*" {
+ pass $gdb_test_name
+ }
+}