From: Tom de Vries Date: Mon, 8 Dec 2025 15:38:29 +0000 (+0100) Subject: [gdb/testsuite] Simplify gdb.multi/remote-with-running-inferior.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f43bece0d804cbdcb29de0f28791bf853ca5d88a;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Simplify gdb.multi/remote-with-running-inferior.exp Simplify regexps in test-case gdb.multi/remote-with-running-inferior.exp using string_to_regexp and {}. While we're at it, also break an overly long line. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.multi/remote-with-running-inferior.exp b/gdb/testsuite/gdb.multi/remote-with-running-inferior.exp index ffa92df66f1..6f8a77c9427 100644 --- a/gdb/testsuite/gdb.multi/remote-with-running-inferior.exp +++ b/gdb/testsuite/gdb.multi/remote-with-running-inferior.exp @@ -57,7 +57,8 @@ proc run_test { target_non_stop non_stop } { gdb_test_no_output "set non-stop $non_stop" # Start the first inferior running in the background. - gdb_test -no-prompt-anchor "run&" "Starting program: .*" "start background inferior" + gdb_test -no-prompt-anchor "run&" "Starting program: .*" \ + "start background inferior" # Add a second inferior. gdb_test "add-inferior" "Added inferior 2.*" @@ -87,26 +88,26 @@ proc run_test { target_non_stop non_stop } { exp_continue } - -re "^\\s+Id\\s+Target Id\\s+Frame\\s*\r\n" { + -re {^\s+Id\s+Target Id\s+Frame\s*\r\n} { exp_continue } - -re "^\\s+1\\.1\\s+\[^\r\n\]+\\(running\\)\r\n" { + -re {^\s+1\.1\s+[^\r\n]+\(running\)\r\n} { set state_inferior_1 "running" exp_continue } - -re "^\\*\\s+2\\.1\\s+\[^\r\n\]+\\(running\\)\r\n" { + -re {^\*\s+2\.1\s+[^\r\n]+\(running\)\r\n} { set state_inferior_2 "running" exp_continue } - -re "^\\s+1\\.1\\s+\[^\r\n\]+\r\n" { + -re {^\s+1\.1\s+[^\r\n]+\r\n} { set state_inferior_1 "stopped" exp_continue } - -re "^\\*\\s+2\\.1\\s+\[^\r\n\]+\r\n" { + -re {^\*\s+2\.1\s+[^\r\n]+\r\n} { set state_inferior_2 "stopped" exp_continue } @@ -130,7 +131,7 @@ proc run_test { target_non_stop non_stop } { "Breakpoint $::decimal at .*" gdb_continue_to_breakpoint "breakpoint in main" gdb_test "bt 1" \ - "#0\\s+main \\(\\) at\[^\r\n\]+" \ + {#0\s+main \(\) at [^\r\n]+} \ "check inferior 2 is in main" # Switch to inferior 1 and allow it to continue. This is a @@ -152,8 +153,8 @@ proc run_test { target_non_stop non_stop } { gdb_continue_to_breakpoint "continue to breakpoint in breakpt" gdb_test "bt 1" \ [multi_line \ - "#0\\s+breakpt \\(\\) at\[^\r\n\]+" \ - "\\(More stack frames follow\\.\\.\\.\\)"] \ + {#0\s+breakpt \(\) at [^\r\n]+} \ + [string_to_regexp "(More stack frames follow...)"]] \ "check inferior 1 is in breakpt" # Switch back to inferior 2. The testing infrastructure will try to