From patchwork Fri Apr 21 14:58:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 68139 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0CD7A3855586 for ; Fri, 21 Apr 2023 14:59:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CD7A3855586 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682089168; bh=2RAtWUQ+Dzzc/SocOMnzVBng8AC3heeg1HOGw/74BbY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=sGD7c+gHEZjtlKBRFgZX8/Lf3mND0eeulmSYRve4lsMSXHt/I9y31ioaJupxQ6psu Kj9/5Hpi0pDCZpaBBJsomecmJYIHQFZ4RiuuWCyrkVx1n9wHRU/t8+X0gfWSS/G3Bd +qndjVa/fRsFSfdfi6azlox/oJZvd3IgySDwk7xQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id AD0923856DDC for ; Fri, 21 Apr 2023 14:58:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD0923856DDC Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E12B41FE20 for ; Fri, 21 Apr 2023 14:58:40 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CEED01390E for ; Fri, 21 Apr 2023 14:58:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wFg9MaCkQmTqDAAAMHmgww (envelope-from ) for ; Fri, 21 Apr 2023 14:58:40 +0000 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 Message-Id: <20230421145833.24521-4-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230421145833.24521-1-tdevries@suse.de> References: <20230421145833.24521-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When editing gdb.gdb/python-helper.exp, auto-indent is broken in my editor (emacs). The problem is that this: ... if { 1 } { foo "{" "}"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