From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A6035385735A for ; Thu, 9 Jun 2022 08:54:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6035385735A 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 1F6AF218B0 for ; Thu, 9 Jun 2022 08:54:22 +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 0982713456 for ; Thu, 9 Jun 2022 08:54:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /d35AD61oWKkWgAAMHmgww (envelope-from ) for ; Thu, 09 Jun 2022 08:54:21 +0000 Date: Thu, 9 Jun 2022 10:54:20 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix regexp in gdb.ada/mi_var_access.exp Message-ID: <20220609085418.GA8028@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 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-List-Received-Date: Thu, 09 Jun 2022 08:54:25 -0000 Hi, With gcc-12 and target board unix/-m32, we run into: ... (gdb) ^M Expecting: ^(-var-create A_String_Access \* A_String_Access[^M ]+)?(\^done,name="A_String_Access",numchild="1",.*[^M ]+[(]gdb[)] ^M [ ]*) -var-create A_String_Access * A_String_Access^M ^error,msg="Value out of range."^M (gdb) ^M FAIL: gdb.ada/mi_var_access.exp: Create varobj (unexpected output) ... What happens is easier to understand if we take things out of the mi context: ... $ gdb -q -batch \ outputs/gdb.ada/mi_var_access/mi_access \ -ex "b mi_access.adb:19" \ -ex run \ -ex "p A_String_Access" ... Breakpoint 1, mi_access () at mi_access.adb:19 19 A_String : String (3 .. 5) := "345"; -- STOP $1 = (pck.string_access) ... while with target board unix we have instead: ... $1 = (pck.string_access) 0x431b40 ... The var-create command samples the value of the variable at a location where the variable is not yet initialized, and with target board unix we accidentally hit a valid address, but with target board unix/-m32 that's not the case. Fix the FAIL by accepting the error message. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27027 Any comments? Thanks, - Tom [gdb/testsuite] Fix regexp in gdb.ada/mi_var_access.exp --- gdb/testsuite/gdb.ada/mi_var_access.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp index 7a9fe7f7f60..0d5e4e949d6 100644 --- a/gdb/testsuite/gdb.ada/mi_var_access.exp +++ b/gdb/testsuite/gdb.ada/mi_var_access.exp @@ -40,8 +40,10 @@ mi_continue_to_line \ "stop at start of mi_access" # The bug was that creating a varobj for A_String_Access would crash. +set re_ok "\\^done,name=\"A_String_Access\",numchild=\"1\",.*" +set re_error "\\^error,msg=\"Value out of range\.\".*" mi_gdb_test "-var-create A_String_Access * A_String_Access" \ - "\\^done,name=\"A_String_Access\",numchild=\"1\",.*" \ + "($re_ok|$re_error)" \ "Create varobj" set bp_location [gdb_get_line_number "STOP2" ${testdir}/mi_access.adb]