From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FjSPCvhm+WAfaAAAWB0awg (envelope-from ) for ; Thu, 22 Jul 2021 08:39:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 159841EDFB; Thu, 22 Jul 2021 08:39:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RDNS_DYNAMIC,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 26DCF1E4A3 for ; Thu, 22 Jul 2021 08:39:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A30D3896802 for ; Thu, 22 Jul 2021 12:39:17 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 7CDC93896C21 for ; Thu, 22 Jul 2021 12:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CDC93896C21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 AD48C2264A; Thu, 22 Jul 2021 12:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626957461; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=3Z7Bm2jiEl6g+aBXnT23AfJiQG+6LpnEcLMinvHB/uY=; b=yYIjOiYdM9ISevd54gPHpDZikxME7ymIGeWGABamdb9dYXRgqoK8RccXcup3qfMerPD9Rt S0bXLSgbY7pC/CptGKsCJpsQKtWV79zj8KB+CBAZJR+tRCFMs61ibnAClawlSI82ToSGqQ s+MS3gZldKl5YOrp5fgYb4N6Yi34i1g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626957461; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=3Z7Bm2jiEl6g+aBXnT23AfJiQG+6LpnEcLMinvHB/uY=; b=paymIPQwoNonAV3YNjGF8nYiEz6HY0xZk3RLJPzzG1dKobUft9djOg1ueJMuCqhETcn7KF XINLa5DxehV4y5Dg== 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 8A9BE13DCE; Thu, 22 Jul 2021 12:37:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id E8xOIJVm+WBQNwAAMHmgww (envelope-from ); Thu, 22 Jul 2021 12:37:41 +0000 Date: Thu, 22 Jul 2021 14:37:40 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix FAILs due to PR gcc/101575 Message-ID: <20210722123738.GA23947@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: , Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.ada/formatted_ref.exp with gcc-11 and target board unix/gdb:debug_flags=-gdwarf-4 we run into: ... (gdb) print/x s^M No definition of "s" in current context.^M (gdb) FAIL: gdb.ada/formatted_ref.exp: print/x s ... which is caused by "runto defs.adb:20" taking us to defs__struct1IP: ... (gdb) break defs.adb:20^M Breakpoint 1 at 0x402cfd: defs.adb:20. (2 locations)^M (gdb) run ^M Starting program: formatted_ref ^M ^M Breakpoint 1, defs__struct1IP () at defs.adb:20^M 20 return s.x; -- Set breakpoint marker here.^M (gdb) print s1'access^M ... instead of the expected defs.f1: ... (gdb) break defs.adb:20^M Breakpoint 1 at 0x402d0e: file defs.adb, line 20.^M (gdb) run ^M Starting program: formatted_ref ^M ^M Breakpoint 1, defs.f1 (s=...) at defs.adb:20^M 20 return s.x; -- Set breakpoint marker here.^M ... This is caused by incorrect line info due to gcc PR 101575 - "[gcc-11, -gdwarf-4] Missing .file directive causes invalid line info". Fix this by when landing in defs__struct1IP: - xfailing the runto, and - issuing a continue to land in defs.f1. Likewise in a few other test-cases. Tested on x86_64-linux, with: - system gcc. - gcc-11 and target boards unix/gdb:debug_flags=-gdwarf-4 and unix/gdb:debug_flags=-gdwarf-5. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix FAILs due to PR gcc/101575 gdb/testsuite/ChangeLog: 2021-07-22 Tom de Vries * gdb.ada/formatted_ref.exp: Add xfail for PR gcc/101575. * gdb.ada/iwide.exp: Same. * gdb.ada/pkd_arr_elem.exp: Same. --- gdb/testsuite/gdb.ada/formatted_ref.exp | 25 ++++++++++++++++++++++++- gdb/testsuite/gdb.ada/iwide.exp | 25 +++++++++++++++++++++++-- gdb/testsuite/gdb.ada/pkd_arr_elem.exp | 26 ++++++++++++++++++++++++-- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.ada/formatted_ref.exp b/gdb/testsuite/gdb.ada/formatted_ref.exp index bc4b36309bd..ea4a7803198 100644 --- a/gdb/testsuite/gdb.ada/formatted_ref.exp +++ b/gdb/testsuite/gdb.ada/formatted_ref.exp @@ -90,7 +90,30 @@ proc test_p_op1_equals_op2 {op1 op2} { clean_restart ${testfile} -runto defs.adb:[gdb_get_line_number "marker here" ${testdir}/defs.adb ] +set bp_location \ + defs.adb:[gdb_get_line_number "marker here" ${testdir}/defs.adb] + +# Workaround gcc PR101575. +#runto $bp_location +gdb_breakpoint "$bp_location" +gdb_run_cmd +set re "Breakpoint $decimal, defs.f1 \\(.*\\) at .*:$decimal.*" +set re_xfail "Breakpoint $decimal, defs__struct1IP \\(\\) at .*:$decimal.*" +set ok 1 +gdb_test_multiple "" "Runto to $bp_location" { + -re -wrap $re { + if { $ok } { + pass $gdb_test_name + } else { + xfail $gdb_test_name + } + } + -re -wrap $re_xfail { + set ok 0 + send_gdb "continue\n" + exp_continue + } +} set s1_address [get_address "s1"] diff --git a/gdb/testsuite/gdb.ada/iwide.exp b/gdb/testsuite/gdb.ada/iwide.exp index 3bb854aad72..0742c504cbf 100644 --- a/gdb/testsuite/gdb.ada/iwide.exp +++ b/gdb/testsuite/gdb.ada/iwide.exp @@ -25,8 +25,29 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional clean_restart ${testfile} -set bp_location [gdb_get_line_number "BREAK" ${testdir}/p.adb] -runto "p.adb:$bp_location" +set bp_location p.adb:[gdb_get_line_number "BREAK" ${testdir}/p.adb] + +# Workaround gcc PR101575. +#runto "$bp_location" +gdb_breakpoint "$bp_location" +gdb_run_cmd +set re "Breakpoint $decimal, p \\(\\) at .*:$decimal.*" +set re_xfail "Breakpoint $decimal, p__P5b.0 \\(\\) at .*:$decimal.*" +set ok 1 +gdb_test_multiple "" "Runto to $bp_location" { + -re -wrap $re { + if { $ok } { + pass $gdb_test_name + } else { + xfail $gdb_test_name + } + } + -re -wrap $re_xfail { + set ok 0 + send_gdb "continue\n" + exp_continue + } +} gdb_test "print My_Drawable" \ "= \\(center => \\(x => 1, y => 2\\), radius => 3\\)" diff --git a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp index 31f78bddc39..2d644c60793 100644 --- a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp +++ b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp @@ -25,8 +25,30 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { clean_restart ${testfile} -set bp_location [gdb_get_line_number "START" ${testdir}/failure.adb] -runto "failure.adb:$bp_location" +set bp_location \ + failure.adb:[gdb_get_line_number "START" ${testdir}/failure.adb] + +# Workaround gcc PR101575. +#runto "$bp_location" +gdb_breakpoint "$bp_location" +gdb_run_cmd +set re "Breakpoint $decimal, failure \\(\\) at .*:$decimal.*" +set re_xfail "Breakpoint $decimal, failure__bounded_funny_stringIP.0 \\(\\) at .*:$decimal.*" +set ok 1 +gdb_test_multiple "" "Runto to $bp_location" { + -re -wrap $re { + if { $ok } { + pass $gdb_test_name + } else { + xfail $gdb_test_name + } + } + -re -wrap $re_xfail { + set ok 0 + send_gdb "continue\n" + exp_continue + } +} # Print Test. The order of the components depends on which version of # the compiler being used, as newer version can re-order the order