]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: fix gdb.btrace/non-stop.exp end of history check
authorGuinevere Larsen <blarsen@redhat.com>
Tue, 27 Aug 2024 11:12:00 +0000 (08:12 -0300)
committerGuinevere Larsen <blarsen@redhat.com>
Wed, 28 Aug 2024 11:41:05 +0000 (08:41 -0300)
The recent commit 089197010993b3a5dc50bf882470bab2de696d92 changed the
warnings when GDB reaches the end of the recorded history, and updated
tests to expect the new messages. The pattern used for
gdb.btrace/non-stop.exp, however, was too broad and could cause the
following test result:

    ...
    (gdb) PASS: gdb.btrace/non-stop.exp: no progress: all: thread apply all continue: prompt
    ^M
    Reached end of recorded history; stopping.^M
    Following forward execution will be added to history.^M
    test (arg=0x0) at /data/vries/gdb/src/gdb/testsuite/gdb.btrace/non-stop.c:30^M
    30        return arg; /* bp.2 */^M
    ^M
    Reached end of recorded history; stopping.^M
    Following forward execution will be added to history.^M
    test (arg=0x0) at /data/vries/gdb/src/gdb/testsuite/gdb.btrace/non-stop.c:30^M
    30        return arg; /* bp.2 */^M
    PASS: gdb.btrace/non-stop.exp: no progress: all: thread apply all continue: thread 0
    FAIL: gdb.btrace/non-stop.exp: no progress: all: thread apply all continue: thread 1 (timeout)
    ...

This happens because the pattern looks like one of these 2:
    "Reached end of recorded.*Backwards execution.*"
    "Reached end of recorded.*Following forward.*"

What seems to have happened is that all the output came at once, and
most of it was consumed by the first '.*' pattern when checking for
thread 0, so there was no output left for checking thread 1. This commit
fixes that by making the expected outputs more exact.

I also fixed the whitespace errors in gdb_cont_to_no_history_backwards
that pre-dated the commit above, since I was already touching that proc.

Approved-By: Tom de Vries <tdevries@suse.de>
gdb/testsuite/gdb.btrace/non-stop.exp

index 5e43545f6a97b131b6aee7f88bb121f609e478b6..8397c2015f8e1113f62a480ddecba3236d1dc18b 100644 (file)
@@ -81,18 +81,20 @@ proc gdb_cont_to_bp_line { line threads nthreads } {
 
 proc gdb_cont_to_no_history_backward { threads cmd nthreads } {
     gdb_cont_to $threads $cmd \
-        [multi_line \
-             "Reached end of recorded.*Backward execution.*" \
-             "\[^\\\r\\\n\]*" \
-             "\[^\\\r\\\n\]*" \
-            ] \
-        $nthreads
+       [multi_line \
+            "Reached end of recorded history; stopping\." \
+            "Backward execution from here not possible\." \
+            "\[^\\\r\\\n\]*" \
+            "\[^\\\r\\\n\]*" \
+            ] \
+       $nthreads
 }
 
 proc gdb_cont_to_no_history_forward { threads cmd nthreads } {
     gdb_cont_to $threads $cmd \
        [multi_line \
-            "Reached end of recorded.*Following forward.*" \
+            "Reached end of recorded history; stopping\." \
+            "Following forward execution will be added to history\." \
             "\[^\\\r\\\n\]*" \
             "\[^\\\r\\\n\]*" \
            ] \