[gdb/testsuite] Fix gdb.dwarf2/dw2-stack-boundary.exp with -readnow
authorTom de Vries <tdevries@suse.de>
Wed, 28 Oct 2020 09:01:32 +0000 (10:01 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 28 Oct 2020 09:01:32 +0000 (10:01 +0100)
When running test-case gdb.dwarf2/dw2-stack-boundary.exp with target board
readnow, we run into:
...
FAIL: gdb.dwarf2/dw2-stack-boundary.exp: check partial symtab errors
...

The cause for the FAIL is that these complaints are not there:
...
During symbol reading: location description stack underflow^M
During symbol reading: location description stack overflow^M
...

Fix this by KFAILing the complaints for -readnow.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-10-28  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/dw2-stack-boundary.exp: KFAILing the complaints for
-readnow.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp

index ffbc01dde63475c250a5b9833320004e6d095c7d..20555ec46468f0b91706c45af9a97cedcfbb5798 100644 (file)
@@ -1,3 +1,8 @@
+2020-10-28  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.dwarf2/dw2-stack-boundary.exp: KFAILing the complaints for
+       -readnow.
+
 2020-10-27  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/multi-forks.exp: Use exp_continue to fix timeout.
index 6971cbc4bd151a54145132dbda907d26f9c6e559..d946679e54891d0629e5a04d08e9d9476654aa55 100644 (file)
@@ -38,7 +38,31 @@ if [is_remote host] {
     }
 }
 gdb_test_no_output "set complaints 100"
-gdb_test "file $binfile" {Reading symbols from .*\.\.\.\r\nDuring symbol reading: location description stack underflow\r\nDuring symbol reading: location description stack overflow} "check partial symtab errors"
+set w1 0
+set w2 0
+gdb_test_multiple "file $binfile" "file command" {
+    -re "\r\nReading symbols from \[^\r\n\]*\\.\\.\\." {
+       exp_continue
+    }
+    -re "\r\nDuring symbol reading: location description stack underflow" {
+       set w1 1
+       exp_continue
+    }
+    -re "\r\nDuring symbol reading: location description stack overflow" {
+       set w2 1
+       exp_continue
+    }
+    -re -wrap "" {
+       pass $gdb_test_name
+    }
+}
+
+set readnow_p [readnow]
+
+if { $readnow_p } {
+    setup_kfail "gdb/26796" *-*-*
+}
+gdb_assert {$w1 && $w2}
 
 gdb_test "p underflow" {Asked for position 0 of stack, stack only has 0 elements on it\.}
 gdb_test "p overflow" " = 2"