]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.threads/ia64-sigill.exp with check-read1
authorTom de Vries <tdevries@suse.de>
Fri, 25 Oct 2024 04:14:03 +0000 (06:14 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 25 Oct 2024 04:14:03 +0000 (06:14 +0200)
Fix test-case gdb.threads/ia64-sigill.exp with make target check-read1 by
using a custom line-by-line exp_continue clause:
...
    -re "\r\n\[^\r\n\]*(?=\r\n\[^\r\n\]*\r\n)" {
exp_continue
    }
...
which drops a line each time it finds two lines in the buffer.

This allows the other clauses to use two-line patterns.

Tested on x86_64-linux.

gdb/testsuite/gdb.threads/ia64-sigill.exp

index 05f998244f61d78921fee3089b69db0f5ce32461..79233ee3bee1a805add74978081d26581febd7d9 100644 (file)
@@ -58,20 +58,35 @@ gdb_test_no_output "set debug infrun 1"
 # The ia64 SIGILL signal is visible only in the linux-nat debug output.
 
 set prompt "$gdb_prompt \\\[infrun\\\] fetch_inferior_event: exit\r\n$"
+set ok 0
 gdb_test_multiple "continue" "continue" -prompt $prompt {
-    -re "Breakpoint \[0-9\]+,( .* in)? thread_func .*$prompt$" {
-       pass $gdb_test_name
+    -re "Breakpoint \[0-9\]+,( \[^\r\n\]+ in)? thread_func \[^\r\n\]+" {
+       set ok 1
+       exp_continue
+    }
+    -re -wrap "" {
+       gdb_assert { $ok } $gdb_test_name
+    }
+    -re "\r\n\[^\r\n\]*(?=\r\n\[^\r\n\]*\r\n)" {
+       exp_continue
     }
 }
 
 gdb_test_no_output {delete $sigill_bpnum}
 
+set ok 0
 gdb_test_multiple "continue" "continue for the pending signal" -prompt $prompt {
-    -re "Breakpoint \[0-9\]+, .*break-at-exit.*\r\n$prompt$" {
+    -re "Breakpoint \[0-9\]+, .*break-at-exit" {
        # Breakpoint has been skipped in the other thread.
-       pass $gdb_test_name
+       set ok 1
     }
     -re " received signal .*\r\n$gdb_prompt $" {
        fail $gdb_test_name
     }
+    -re -wrap "" {
+       gdb_assert { $ok } $gdb_test_name
+    }
+    -re "\r\n\[^\r\n\]*(?=\r\n\[^\r\n\]*\r\n)" {
+       exp_continue
+    }
 }