Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 1/3] [gdb/testsuite] Clean up gdb.mi/pr11022.exp
Date: Sun,  1 Nov 2026 16:51:51 +0100	[thread overview]
Message-ID: <20261101155153.640893-2-tdevries@suse.de> (raw)
In-Reply-To: <20261101155153.640893-1-tdevries@suse.de>

Clean up test-case gdb.mi/pr11022.exp:
- use build_executable instead of gdb_compile
- remove double spaces
- fix indentation
- don't use global
- remove unnecessary escaping

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.mi/pr11022.exp | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/pr11022.exp b/gdb/testsuite/gdb.mi/pr11022.exp
index 35e31af95b1..8644fadf7ed 100644
--- a/gdb/testsuite/gdb.mi/pr11022.exp
+++ b/gdb/testsuite/gdb.mi/pr11022.exp
@@ -20,46 +20,47 @@ set MIFLAGS "-i=mi"
 
 standard_testfile .c
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return
+if {[build_executable "failed to prepare" $testfile]} {
+    return
 }
 
 proc test_memory_changed_observer { mi_command } {
     with_test_prefix "${mi_command}" {
-	global srcfile binfile
-
 	mi_clean_restart $::testfile
 	mi_runto_main
 
 	set line_number [gdb_get_line_number "break here"]
-	mi_gdb_test "-break-insert ${srcfile}:${line_number}" \
+	mi_gdb_test "-break-insert $::srcfile:$line_number" \
 	    {\^done,bkpt=.number="2",type="breakpoint".*\}} \
 	    "set breakpoint"
 
 	mi_gdb_test "watch x" ".*" "set watchpoint"
 
 	mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
-	    { "" "disp=\"keep\"" } "breakpoint hit"
+	    { "" {disp="keep"} } "breakpoint hit"
 
 	mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
-	    { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"0\",new=\"42\"\}" } \
+	    [list \
+		 "" \
+		 {wpt={number="3",exp="x"},value={old="0",new="42"}}] \
 	    "watchpoint hit"
 
 	mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
-	    { "" "disp=\"keep\"" } "breakpoint hit 2"
+	    { "" {disp="keep"} } "breakpoint hit 2"
 
 	mi_gdb_test "-${mi_command}" {\^done} "set x"
 
 	mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
-	    { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"1\",new=\"42\"\}" } \
+	    [list \
+		 "" \
+		 {wpt={number="3",exp="x"},value={old="1",new="42"}}] \
 	    "watchpoint hit 2"
 
 	mi_gdb_exit
     }
 }
 
-test_memory_changed_observer "data-write-memory-bytes &x \"01\""
+test_memory_changed_observer {data-write-memory-bytes &x "01"}
 # We want to trigger a target memory write here, so the word size (4 or 8)
 # is not that important.
-test_memory_changed_observer "data-write-memory &x x 4 \"01\""
+test_memory_changed_observer {data-write-memory &x x 4 "01"}
-- 
2.51.0


  reply	other threads:[~2026-11-01 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 15:51 [pushed 0/3] [gdb/testsuite] Some gdb.mi/pr11022.exp fixes Tom de Vries
2026-11-01 15:51 ` Tom de Vries [this message]
2026-11-01 15:51 ` [pushed 2/3] [gdb/testsuite] Refactor gdb.mi/pr11022.exp Tom de Vries
2026-11-01 15:51 ` [pushed 3/3] [gdb/testsuite] Fix gdb.mi/pr11022.exp on big endian Tom de Vries

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=20261101155153.640893-2-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