From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Use multi_line more often
Date: Fri, 4 Sep 2026 08:09:50 +0200 [thread overview]
Message-ID: <20260904060950.32658-1-tdevries@suse.de> (raw)
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
reply other threads:[~2026-09-04 6:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904060950.32658-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox