public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp
@ 2023-05-31 20:06 Thiago Jung Bauermann
  2023-06-01  7:30 ` Bruno Larsen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Thiago Jung Bauermann @ 2023-05-31 20:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

This testcase sometimes gets stuck in a loop for hours when running in our
CI. The problem is that due to an issue unrelated to reverse debugging the
inferior exits early, and because of the overly generic ".*" pattern the
testcase keeps sending the "next" command without noticing that the
inferior is gone.

gdb_test_multiple has a pattern to detect that "The program is not being
run.", but since it is placed after the patterns from the caller it won't
be triggered. It also has a timeout pattern, but for some reason I don't
understand it often doesn't trigger.

Since the test binary is compiled with debug information, fix by changing
the pattern to match the source code line number that is shown by GDB right
after the "step" command.
---
 gdb/testsuite/gdb.reverse/step-reverse.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
index 729218d4cb8c..766ca02910af 100644
--- a/gdb/testsuite/gdb.reverse/step-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
@@ -261,7 +261,7 @@ if { "$step_out" == 1 } {
 	-re -wrap "NEXT OVER THIS RECURSION.*" {
 	    set step_out 0
 	}
-	-re -wrap ".*" {
+	-re -wrap "^\[0-9\].*"  {
 	    send_gdb "next\n"
 	    exp_continue
 	}
@@ -286,7 +286,7 @@ gdb_test_multiple "next" "step over recursion inside the recursion" {
 	gdb_assert {"$seen_recursive_call" == 1} \
 	    "step over recursion inside the recursion"
     }
-    -re -wrap ".*" {
+    -re -wrap "^\[0-9\].*" {
 	send_gdb "next\n"
 	exp_continue
     }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-01 21:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 20:06 [PATCH] gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp Thiago Jung Bauermann
2023-06-01  7:30 ` Bruno Larsen
2023-06-01  9:15 ` Tom de Vries
2023-06-01  9:40   ` Bruno Larsen
2023-06-01 13:27     ` Thiago Jung Bauermann
2023-06-01 14:04       ` Bruno Larsen
2023-06-01 21:50         ` Thiago Jung Bauermann
2023-06-01  9:32 ` Andrew Burgess
2023-06-01 13:21   ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).