[gdb/testsuite] Handle no glibc debuginfo in gdb.base/solib-corrupted.exp
authorTom de Vries <tdevries@suse.de>
Mon, 14 Dec 2020 16:05:11 +0000 (17:05 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 14 Dec 2020 16:05:11 +0000 (17:05 +0100)
When running test-case gdb.base/solib-corrupted.exp on SLE-11, I get:
...
(gdb) PASS: gdb.base/solib-corrupted.exp: normal list
p/x _r_debug->r_map->l_next = _r_debug->r_map^M
'_r_debug' has unknown type; cast it to its declared type^M
(gdb) FAIL: gdb.base/solib-corrupted.exp: make solibs looping
...

The reason that _r_debug has unknown type is that glibc debuginfo is not
installed.  The test-case attempts to detect this but doesn't handle this
particular error string.

Fix this by adding the "unknown type" line to the regexp detecting missing
glibc debuginfo.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-12-14  Tom de Vries  <tdevries@suse.de>

PR testsuite/26962
* gdb.base/solib-corrupted.exp: Handle "'_r_debug' has unknown type;
cast it to its declared type".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/solib-corrupted.exp

index 4bd45211c7b2726114ee3e22f8aab80bd1ca11d4..9a20e7ec65ac67246d8bac441e48b7d4a545e0cb 100644 (file)
@@ -1,3 +1,9 @@
+2020-12-14  Tom de Vries  <tdevries@suse.de>
+
+       PR testsuite/26962
+       * gdb.base/solib-corrupted.exp: Handle "'_r_debug' has unknown type;
+       cast it to its declared type".
+
 2020-12-14  Tom de Vries  <tdevries@suse.de>
 
        PR testsuite/26951
index 5ee943cae1050bc86eadb3d1fc41e8683977b454..902ef9cc7acf44e8d4deb6b9485be64ae621f7ec 100644 (file)
@@ -64,10 +64,20 @@ if { [llength $probes] == 0 } {
 
 gdb_test "info sharedlibrary" "From * To .*" "normal list"
 
+set no_glibc_debuginfo_re1 "No symbol \"_r_debug\" in current context\\."
+set no_glibc_debuginfo_re2 \
+    [concat \
+        "Attempt to extract a component of a value that is not a structure" \
+        " pointer\\."]
+set no_glibc_debuginfo_re3 \
+    "'_r_debug' has unknown type; cast it to its declared type"
+set no_glibc_debuginfo_re \
+    "($no_glibc_debuginfo_re1|$no_glibc_debuginfo_re2|$no_glibc_debuginfo_re3)"
+
 # GDB checks there for matching L_PREV.
 set test "make solibs looping"
 gdb_test_multiple "p/x _r_debug->r_map->l_next = _r_debug->r_map" $test {
-    -re "(No symbol \"_r_debug\" in current context\\.|Attempt to extract a component of a value that is not a structure pointer\\.)\r\n$gdb_prompt $" {
+    -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
This page took 0.033692 seconds and 4 git commands to generate.