* [pushed] [gdb/testsuite] Use multi_line more often
@ 2026-09-04 6:09 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2026-09-04 6:09 UTC (permalink / raw)
To: gdb-patches
I came across two test-cases using [join $list "\r\n"].
Use multi_line for this.
While we're at it, simplify the lists using quotemeta.
---
gdb/testsuite/gdb.ada/task_watch.exp | 26 ++++++++++++++------------
gdb/testsuite/gdb.ada/tasks.exp | 26 ++++++++++++++------------
2 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/task_watch.exp
index 7031abf41ff..06fc7af9db7 100644
--- a/gdb/testsuite/gdb.ada/task_watch.exp
+++ b/gdb/testsuite/gdb.ada/task_watch.exp
@@ -35,12 +35,13 @@ runto "foo.adb:$bp_location"
# Make sure that all tasks appear in the "info tasks" listing, and
# that the active task is the environment task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- "\\* +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- " +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
+ [quotemeta \
+ [multi_line \
+ " ID TID P-ID Pri State Name" \
+ "* 1 @... main_task" \
+ " 2 @... task_list(1)" \
+ " 3 @... task_list(2)" \
+ " 4 @... task_list(3)"]] \
"info tasks before inserting breakpoint"
# Insert a watchpoint that should stop only if task 3 stops, and
@@ -69,12 +70,13 @@ gdb_test "continue" \
# Check that it is indeed task 3 that hit the watchpoint by checking
# which is the active task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- " +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- "\\* +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
+ [quotemeta \
+ [multi_line \
+ " ID TID P-ID Pri State Name" \
+ " 1 @... main_task" \
+ " 2 @... task_list(1)" \
+ "* 3 @... task_list(2)" \
+ " 4 @... task_list(3)"]] \
"info tasks after hitting watchpoint"
# Now, resume the execution and make sure that GDB does not stop when
diff --git a/gdb/testsuite/gdb.ada/tasks.exp b/gdb/testsuite/gdb.ada/tasks.exp
index b37cf0cadd1..c445b3ac402 100644
--- a/gdb/testsuite/gdb.ada/tasks.exp
+++ b/gdb/testsuite/gdb.ada/tasks.exp
@@ -33,12 +33,13 @@ runto "foo.adb:$bp_location"
# Make sure that all tasks appear in the "info tasks" listing, and
# that the active task is the environment task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- "\\* +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- " +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
+ [quotemeta \
+ [multi_line \
+ " ID TID P-ID Pri State Name" \
+ "* 1 @... main_task" \
+ " 2 @... task_list(1)" \
+ " 3 @... task_list(2)" \
+ " 4 @... task_list(3)"]] \
"info tasks before inserting breakpoint"
# Confirm that the "info threads" output lines up with the tasks list.
@@ -165,12 +166,13 @@ gdb_test "continue" \
# Check that it is indeed task 3 that hit the breakpoint by checking
# which is the active task.
gdb_test "info tasks" \
- [join {" +ID +TID P-ID Pri State +Name" \
- " +1 .* main_task" \
- " +2 .* task_list\\(1\\)" \
- "\\* +3 .* task_list\\(2\\)" \
- " +4 .* task_list\\(3\\)"} \
- "\r\n"] \
+ [quotemeta \
+ [multi_line \
+ " ID TID P-ID Pri State Name" \
+ " 1 @... main_task" \
+ " 2 @... task_list(1)" \
+ "* 3 @... task_list(2)" \
+ " 4 @... task_list(3)"]] \
"info tasks after hitting breakpoint"
# Now, resume the execution and make sure that GDB does not stop when
base-commit: 265b8b7b1edb2da885396e89f03acb5d5e2c6832
--
2.51.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-04 6:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 6:09 [pushed] [gdb/testsuite] Use multi_line more often Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox