public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/3] [gdb/testsuite] Fix auto-indent in gdb.gdb/python-helper.exp
Date: Fri, 21 Apr 2023 16:58:33 +0200	[thread overview]
Message-ID: <20230421145833.24521-4-tdevries@suse.de> (raw)
In-Reply-To: <20230421145833.24521-1-tdevries@suse.de>

When editing gdb.gdb/python-helper.exp, auto-indent is broken in my editor
(emacs).

The problem is that this:
...
if { 1 } {
    foo "{" "}"<ENTER>bar
}
...
produces this:
...
if { 1 } {
    foo "{" "}"
bar
}
...

Note that this doesn't happen for "{}".

Fix this by using "\{" and "\}".

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.gdb/python-helper.exp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp
index a2dbeee4815..217f123302d 100644
--- a/gdb/testsuite/gdb.gdb/python-helper.exp
+++ b/gdb/testsuite/gdb.gdb/python-helper.exp
@@ -132,22 +132,22 @@ proc test_python_helper {} {
     # pretty printers.
     set answer [multi_line \
 		    "${decimal} = " \
-		    "{pointer_type = 0x0," \
+		    "\{pointer_type = 0x0," \
 		    " reference_type = 0x0," \
 		    " chain = 0x0," \
 		    " instance_flags = 0," \
 		    " length = $decimal," \
-		    " main_type = $hex}"]
+		    " main_type = $hex\}"]
     gdb_test -prompt $outer_prompt_re "print *val->m_type" $answer "pretty print type"
 
     set answer [multi_line \
 		    "$decimal = " \
-		    "{name = $hex \"int\"," \
+		    "\{name = $hex \"int\"," \
 		    " code = TYPE_CODE_INT," \
 		    " flags = \[^\r\n\]+," \
 		    " owner = $hex \\(gdbarch\\)," \
 		    " target_type = 0x0," \
-		    " int_stuff = { bit_size = $decimal, bit_offset = $decimal }}"]
+		    " int_stuff = \{ bit_size = $decimal, bit_offset = $decimal \}\}"]
     gdb_test -prompt $outer_prompt_re "print *val->m_type->main_type" $answer "pretty print type->main_type"
 
     # Send the continue to the outer GDB, which resumes the inner GDB,
@@ -170,12 +170,12 @@ proc test_python_helper {} {
 
     set answer [multi_line \
 		    "$decimal = " \
-		    "{name = $hex \"int\"," \
+		    "\{name = $hex \"int\"," \
 		    " code = TYPE_CODE_INT," \
 		    " flags = \[^\r\n\]+," \
 		    " owner = $hex \\(objfile\\)," \
 		    " target_type = 0x0," \
-		    " int_stuff = { bit_size = $decimal, bit_offset = $decimal }}"]
+		    " int_stuff = \{ bit_size = $decimal, bit_offset = $decimal \}\}"]
     gdb_test -prompt $outer_prompt_re "print *val->m_type->main_type" $answer "pretty print type->main_type for DWARF type"
 
     # Send the continue to the outer GDB, which resumes the inner GDB,
@@ -227,18 +227,18 @@ proc test_python_helper {} {
     if { $cmd_supported } {
 	set answer [multi_line \
 			"$decimal = " \
-			"{name = $hex \"CC\"," \
+			"\{name = $hex \"CC\"," \
 			" code = TYPE_CODE_STRUCT," \
 			" flags = \[^\r\n\]+," \
 			" owner = $hex \\(objfile\\)," \
 			" target_type = 0x0," \
 			" flds_bnds\\.fields\\\[0\\\]:" \
-			"  {m_name = $hex \"m_val\"," \
+			"  \{m_name = $hex \"m_val\"," \
 			"   m_type = $hex," \
 			"   m_loc_kind = FIELD_LOC_KIND_BITPOS," \
 			"   bitsize = 0," \
-			"   bitpos = 0}," \
-			" cplus_stuff = $hex}"]
+			"   bitpos = 0\}," \
+			" cplus_stuff = $hex\}"]
 	gdb_test -prompt $outer_prompt_re $cmd $answer
     } else {
 	unsupported $cmd
-- 
2.35.3


  parent reply	other threads:[~2023-04-21 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 14:58 [PATCH 0/3] [gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 -flto Tom de Vries
2023-04-21 14:58 ` [PATCH 1/3] [gdb/testsuite] Fix -wrap in presence of -prompt in gdb_test_multiple Tom de Vries
2023-04-21 14:58 ` [PATCH 2/3] [gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 -flto Tom de Vries
2023-04-21 14:58 ` Tom de Vries [this message]
2023-04-24 17:09 ` [PATCH 0/3] " Tom Tromey

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=20230421145833.24521-4-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).