From: Guinevere Larsen Date: Tue, 27 Aug 2024 11:12:00 +0000 (-0300) Subject: gdb/testsuite: fix gdb.btrace/non-stop.exp end of history check X-Git-Tag: gdb-16-branchpoint~1055 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e3759c2609c25c4ee59726e3c97e0f2a7c40311;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: fix gdb.btrace/non-stop.exp end of history check 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 --- diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp index 5e43545f6a9..8397c2015f8 100644 --- a/gdb/testsuite/gdb.btrace/non-stop.exp +++ b/gdb/testsuite/gdb.btrace/non-stop.exp @@ -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\]*" \ ] \