From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KFqhIijtomI9GgEAWB0awg (envelope-from ) for ; Fri, 10 Jun 2022 03:05:12 -0400 Received: by simark.ca (Postfix, from userid 112) id 77BD81E223; Fri, 10 Jun 2022 03:05:12 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=r4qwg1Hw; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 116F81E143 for ; Fri, 10 Jun 2022 03:05:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 86EEB383EC45 for ; Fri, 10 Jun 2022 07:05:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86EEB383EC45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654844711; bh=mgc78gUaDPf2xi1TZJJEqD9+DaCjAkMv2JCPIkRhCP8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=r4qwg1HwOkhkavBZ7Yl2mAdZQCRoUEegMXejnj4xJZ+cISQ/Rk5cgb74UxS+JW2PL AnvdGmqM+iA1mZD4mq0Nb843XGBMaMXrC9pkmD+X6NcMF9Z3wSRHCnfQDD8v0qcNT2 vY6o/I3Mn7jNZAUjv3jALRtRFBckAPLQweIdDeNM= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 8D6AA38425BE for ; Fri, 10 Jun 2022 07:04:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D6AA38425BE 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 C79241F86B for ; Fri, 10 Jun 2022 07:04:51 +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 A86BB139ED for ; Fri, 10 Jun 2022 07:04:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UGr2JxPtomKpKgAAMHmgww (envelope-from ) for ; Fri, 10 Jun 2022 07:04:51 +0000 Date: Fri, 10 Jun 2022 09:04:50 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix regexp in gdb.ada/mi_var_access.exp Message-ID: <20220610070448.GA15810@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-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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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]