From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2085.outbound.protection.outlook.com [40.107.104.85]) by sourceware.org (Postfix) with ESMTPS id E25293858D32 for ; Thu, 13 Apr 2023 13:56:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E25293858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JLTCZBNh1WCuk3xR47REzGvAGHz9rnyDbTwwX9K/Z9g=; b=Htmh9O1QS0uVJrbEn3By1oBK+ndvFOovzLj5MHo3Rg75iISmYq+2EJIUAu9RKaGOMQP/sqvk2Hgr0Tn7PLV0GlgP4KwEH9FWzJM1Dl3xQsejEphlP1qNC5qS+Z7nHg3PiSIGbWzf55ZRd41Eord0vhYSHIsEl1+CeZ29qf25foM= Received: from DUZPR01CA0033.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::8) by AS8PR08MB8634.eurprd08.prod.outlook.com (2603:10a6:20b:564::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 13:56:17 +0000 Received: from DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:468:cafe::9c) by DUZPR01CA0033.outlook.office365.com (2603:10a6:10:468::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 13:56:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT006.mail.protection.outlook.com (100.127.142.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 13:56:17 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 13 Apr 2023 13:56:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2a6b3990d956bdbd X-CR-MTA-TID: 64aa7808 Received: from 513505adc551.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 99C08B10-3E30-4817-81F8-1451E6904D6F.1; Thu, 13 Apr 2023 13:56:09 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 513505adc551.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 13:56:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ByR1yOdVKurZiI81D0Yt2ptDs8TVPqF7mr1CMw35CSztvtkwLIa+IbSjXz6HtaKgvmhHQDYH7I0VPW3TQo0ao3L+NnAIsmP841Yy74LOhvwZ9cco6kT83LM6+8UqDtTro91C9QXKmEDbgM6f2BmSAERPoBoFWH1OQnAkrBIvEXA5225gamGHgC/zUAe+tWHg+3lGHifyqEh586loucX7mBQ3ZcTrDddzb2AcBzvHxcgp5AXruelHZ2u9//iAh+QUujI4w/CwlT0cC5S+LdV5fboR3pEYnltguS1fftqvgJ8tVFXuMmCChs9FJPbP6Zi6MB5HKH+h/dKE+9Jc5T7+0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JLTCZBNh1WCuk3xR47REzGvAGHz9rnyDbTwwX9K/Z9g=; b=U/m03siCYtSbFJjtcXGQhL6Hm3wW1AkSPO8fVYdq/aG3Mqcl0R4GvZwAfrBm4hzbQdV9yg+7KgpXWM06Qtc9UXN4bb+C7QloO53VBMsvL/11ubwuiVbN/WDb5gHIkD063CiFQPH2R88UZwlJbPwVKmHoBlD6CUdRwVXLomqnRlYzCkoemdZWnfhkWi3YJJzJm/xGHYNFJl19klyoXaDi/1QR69maUljqi4AU1E1lfZ34JmMaQyCE9+qU7KU9qtAS5iBf8Gt8BGAwFWGKeYu0ueOfEE6fSwQcQwc/d+lbxX5wjnqjnclE+mwsAt6Xkf9t7Xhdv2BeuGeMxrGKTrUf2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JLTCZBNh1WCuk3xR47REzGvAGHz9rnyDbTwwX9K/Z9g=; b=Htmh9O1QS0uVJrbEn3By1oBK+ndvFOovzLj5MHo3Rg75iISmYq+2EJIUAu9RKaGOMQP/sqvk2Hgr0Tn7PLV0GlgP4KwEH9FWzJM1Dl3xQsejEphlP1qNC5qS+Z7nHg3PiSIGbWzf55ZRd41Eord0vhYSHIsEl1+CeZ29qf25foM= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB9478.eurprd08.prod.outlook.com (2603:10a6:20b:5ed::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 13:55:59 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf%5]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 13:55:58 +0000 Message-ID: Date: Thu, 13 Apr 2023 14:55:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] gdb.base/watchpoint-unaligned.exp: Fix TCL error. Content-Language: en-US To: =?UTF-8?Q?Alexandra_H=c3=a1jkov=c3=a1?= , gdb-patches@sourceware.org References: <20230412210846.127441-1-ahajkova@redhat.com> From: Luis Machado In-Reply-To: <20230412210846.127441-1-ahajkova@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO6P123CA0042.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2fe::13) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB9478:EE_|DBAEUR03FT006:EE_|AS8PR08MB8634:EE_ X-MS-Office365-Filtering-Correlation-Id: 41544c3a-f4ea-4b0d-9366-08db3c26da3c x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: dj3A70b61Z2PBGSPoVwsEyOivcfZbNZ1LgvhUX3VLkPhWV7N3wmJzuXlx+nxIDm2A609K3ya42JS6cLhrb1WLnbbmIvcFC9BW+ukooZernQ1blvQTgSMoR4xzdkdHCC/yygMAPhVfoi4WiLmsZ0XxZadcPI9DmMa4fJ7rmNA4DfOEr9TTCUiUTB7vhzm6ngCm6C14NROUSNAu9zDUWPYT+t5wWYKaUkFIlr8dMpDYERwo7VNuDlIIbuoOUio+AR53XMhICNlka0/9ThUNWzkIufPGDpV+j3X/SGmaffTl3sNCgiCz9WMe2ffxEubsho3xVYOFhLVCRzOKWeoC+tYs2yxqGkWj9B+WQxQ/gXede17w3/+b1yv7ludNBoplzaSHLmqWjiW92quyij98fOjz7YFr0QBUsRbCoWgnztMO4VHVdlhLTOWr0pOmHUFqvLNUW+9hJPDrGkLLNnNjkfOvrDyerlbyIATqh6bh81llMuenzcDQn+d/2gUQvaBoNN3dO0SbXlMscpg6ryidyjNmLjM/UZdVE3bzxKu+aDFqROg/XCcX+Asu4d2wSwRYke9H+r72D8v8+e0q5CIbuoGEihaGSteMmJxd+h5KyRdjt6t/sE0uFz+Prk5H023ICmJD4nviMGKoTj32tTKp/LDQg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(366004)(451199021)(6666004)(6486002)(966005)(66476007)(66556008)(66946007)(36756003)(2906002)(44832011)(31696002)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(478600001)(53546011)(6512007)(6506007)(26005)(31686004)(2616005)(186003)(83380400001)(66574015)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9478 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 878177a9-c7d9-487f-3077-08db3c26ce92 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VPIs6we2o8jT4++jCKkjz2qPEu0IOKPlUfbZL0TgPYrLYpC8O/XUwWMUCGUiRpbK8drcr0FBg73daTHr1SHZlrXAlvcOqOewY1tgJBX7w5D7TeSyYaiKRZNsSGaE/fYxd0eX+p+XER6KNG9sXKNoDbxs/N62v5JlIO/npTcEpY1JX1IFy1kZP8cGoQdm3Az8hh1++pUUwur+SI8tk/AkUP9U/ByEdcAHTFjY2QXrMpDTKgIjbVH8bgtGTgW5bRNwqVo4uhPE8B9jEEM0so/i3KpVGpe75BdD7kG6hNdzdnJarJG16VU36mYN59qHYhCCH0geEdpYaDmhBaWtxu4/hCJNi7CZSuKif6LFkbWvuGlokIUS9SMmGS/vAqsrBg7MdRvo1TdFbx2s4YZpHNcmXotPDZW8StGYX+AhiHQc/c+sOoYTcuOaG4gdkIllFrBMAgFXVZ/u9lHjN/Ief9CIyELmB+UZ/o9X9zKD2mmccnA2N3BmLKtk3fk5q3AeeK9U7qRHjoSar3aoIjVR+OctprAib2+RuH0A7+eLAc7d1Gn/2mUW87w3i/BGD1YZrJkKPWBn+cYgvKPjhJfawgg+8PW+MokuIg1Behx2aqXl+PXDvb+w7yhrnCBwjlwOQnfvOhA4JQ4mmdUwYWxqlqdTnzk4QdKvD+XaEueM8dd3LHL69jCHBO20I3ssOH7Okg/cKtxS4lBqSIO84EXEPHpO5QFi2jePukfEvKZS404og3g= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(6486002)(40460700003)(966005)(70206006)(70586007)(36756003)(2906002)(44832011)(31696002)(86362001)(81166007)(82740400003)(356005)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(53546011)(6512007)(6506007)(26005)(31686004)(336012)(36860700001)(2616005)(186003)(47076005)(83380400001)(66574015)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 13:56:17.0883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41544c3a-f4ea-4b0d-9366-08db3c26da3c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8634 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/12/23 22:08, Alexandra Hájková via Gdb-patches wrote: > From: Alexandra Hajkova > > When running this test on aarch64 I've got TCL error: > ERROR: can't read "wpoffset_to_wpnum(1)": no such element in array > ERROR: tcl error code TCL READ VARNAME > ERROR: tcl error info: > can't read "wpoffset_to_wpnum(1)": no such element in array ... > > This patch adds checks whether the wpoffset_to_wpnum array member > exists to avoid the error. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30340 > --- > .../gdb.base/watchpoint-unaligned.exp | 38 ++++++++++--------- > 1 file changed, 21 insertions(+), 17 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp > index ce5a1e5bf66..d470368a6e3 100644 > --- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp > +++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp > @@ -121,27 +121,31 @@ foreach wpcount {4 7} { > gdb_test_no_output -nopass "set variable offset = 1" > set test "continue" > set got_hit 0 > - gdb_test_multiple $test $test { > - -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { > - } > - -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alue = .*\r\n$gdb_prompt $" { > - set got_hit 1 > - send_gdb "continue\n" > - exp_continue > - } > - -re " start_again .*\r\n$gdb_prompt $" { > - } > + if {[info exists wpoffset_to_wpnum(1)]} { > + gdb_test_multiple $test $test { > + -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { > + } > + -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alue = .*\r\n$gdb_prompt $" { > + set got_hit 1 > + send_gdb "continue\n" > + exp_continue > + } > + -re " start_again .*\r\n$gdb_prompt $" { > + } > + } > } > for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} { > - if {$wpoffset_to_wpnum($wpoffset)} { > - gdb_test_no_output "delete $wpoffset_to_wpnum($wpoffset)" "" > - } > + if {[info exists wpoffset_to_wpnum($wpoffset)] && > + $wpoffset_to_wpnum($wpoffset)} { > + gdb_test_no_output "delete $wpoffset_to_wpnum($wpoffset)" "" > + } > } > set test "wpcount($wpcount)" > - if {!$wpoffset_to_wpnum([expr $wpcount - 1])} { > - untested $test > - continue > - } > + if {[info exists wpoffset_to_wpnum([expr $wpcount - 1])] && > + !$wpoffset_to_wpnum([expr $wpcount - 1])} { > + untested $test > + continue > + } > if {$wpcount > 4} { > if {![istarget "s390*-*-*"]} { > setup_kfail tdep/22389 *-*-* As I commented on the bug ticket, I think a better approach is to check for errors and then bail out of the test if one is found. If we can't insert watchpoints, it is probably not worth continuing to run checks. We will end up with a pile of failures.