From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 22A893853564 for ; Thu, 20 Oct 2022 07:02:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22A893853564 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-out1.suse.de (Postfix) with ESMTPS id 2675322D85 for ; Thu, 20 Oct 2022 07:02: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 122C4139D2 for ; Thu, 20 Oct 2022 07:02:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EvUpA5DyUGPSeAAAMHmgww (envelope-from ) for ; Thu, 20 Oct 2022 07:02:40 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix gdb.mi/mi-disassemble.exp with check-read1 Date: Thu, 20 Oct 2022 09:02:39 +0200 Message-Id: <20221020070239.17913-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP 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-List-Received-Date: Thu, 20 Oct 2022 07:02:42 -0000 With test-case gdb.mi/mi-disassemble.exp and check-read1 I run into: ... FAIL: gdb.mi/mi-disassemble.exp: disassemble /b main FAIL: gdb.mi/mi-disassemble.exp: get valueof "*((unsigned char *) 0x400549)" ... The problem for both FAILs is that the output is parsed using gdb_test_multiple, which has implicit clauses using $gdb_prompt, which can match before the explicit clauses using $mi_gdb_prompt. Fix this by passing -prompt "$mi_gdb_prompt$" to gdb_test_multiple. Tested on x86-64-linux. --- gdb/testsuite/gdb.mi/mi-disassemble.exp | 2 +- gdb/testsuite/lib/mi-support.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp index cac3689071c..d2b60f1bb22 100644 --- a/gdb/testsuite/gdb.mi/mi-disassemble.exp +++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp @@ -269,7 +269,7 @@ proc test_disassembly_opcode_format {} { # then disassemble using the MI command. set longest_insn_bytes "" set longest_insn_addr "" - gdb_test_multiple "disassemble /b main" "" { + gdb_test_multiple "disassemble /b main" "" -prompt "$::mi_gdb_prompt$" { -re "^disassemble /b main\r\n" { exp_continue } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 2b534f5d871..e537d3b546b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2849,7 +2849,7 @@ proc mi_get_valueof { fmt exp default {test ""} } { } set val ${default} - gdb_test_multiple "print${fmt} ${exp}" "$test" { + gdb_test_multiple "print${fmt} ${exp}" "$test" -prompt "$::mi_gdb_prompt$" { -re "~\"\\$\[0-9\]* = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" { set val $expect_out(1,string) pass "$test" base-commit: 53707efa1b9d04a844c445a446c0523e509ac61c -- 2.35.3