From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150084.outbound.protection.outlook.com [40.107.15.84]) by sourceware.org (Postfix) with ESMTPS id 7F5103858C27 for ; Mon, 14 Mar 2022 09:30:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F5103858C27 Received: from AM6P195CA0022.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::35) by AM6PR08MB2951.eurprd08.prod.outlook.com (2603:10a6:209:4e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.26; Mon, 14 Mar 2022 09:30:56 +0000 Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:81:cafe::67) by AM6P195CA0022.outlook.office365.com (2603:10a6:209:81::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Mon, 14 Mar 2022 09:30:56 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.23 via Frontend Transport; Mon, 14 Mar 2022 09:30:55 +0000 Received: ("Tessian outbound 31aeb3346a45:v113"); Mon, 14 Mar 2022 09:30:55 +0000 X-CR-MTA-TID: 64aa7808 Received: from c12025d7e913.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8A5D53E8-918F-40DC-A8D8-46F00A7577F5.1; Mon, 14 Mar 2022 09:30:29 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c12025d7e913.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 14 Mar 2022 09:30:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QJ62bK+Chr5rlaHk3NJx7Wqjo3OZGKKeNNSNsSQlx53JKKO8nJJ/p0Jl0srYkxSheZNeje4Xr3UC7qhz9Bs95YMzusVh9CeHl/FOxoNnKEEFvIJJ/WnxRpHiJoOcU19OjrkavLimWCUfyOg9HeM11xzfLbCqAzC9UUshXMpaH5DKjmsifS/Wqe3n3du931uI0//8EuDEkQZtd0bTSRQgaoniHgyzMPoIOK4GA122Dr/xHGkvPdIjbBgd5lacmGISLQA3L/xsc+hc4pNHtDLYhuF0USgQRCt+AFGvphX49uXHxjxO0mLwsar/Zl3FLd1N+j2FM4XX6jSWVfl/o6uu8g== 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=57fK9SjAVEEOzXdIMqL1RwPCI+Qfc/FusTToR3ALejc=; b=k13o+8+WoQ6EtBGZND0xq5OVYBdUPzyhQ7co7soauvlsPBGygSXNL8tlEZHOds/5BQbOSB0zN023pu4nzuvaId+UyBzytiYWhrEpSoa+HXGU4urQtlwmnHP9iSvC1Aztq1ARz5PUB7/lbgP9j17rm/He/y4M8Cw+mFKTUncFWm0jXMTLZRQpQyari6yynaxB+XHUnRsF48a/zW8PJl5ytYcf0XD+BfdaNMf15kw3E+cFi0ghVE7JJsPtXDeEzm8sIPA7ne+EHxoEuAQxZOgD4y0oGWgBFhmSu+1B2gOmvTkrlmMxpJ1QMrSL2cAVZXgNXQPbOMB/2IAQzyW755witg== 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 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 AM0PR08MB5362.eurprd08.prod.outlook.com (2603:10a6:208:180::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Mon, 14 Mar 2022 09:30:26 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::4d3d:c632:297e:1dcc]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::4d3d:c632:297e:1dcc%5]) with mapi id 15.20.5061.028; Mon, 14 Mar 2022 09:30:26 +0000 Message-ID: <00c20109-0a0c-b70c-a962-5a64539cc43a@arm.com> Date: Mon, 14 Mar 2022 09:30:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] Implement gdbarch_stack_frame_destroyed_p for aarch64 Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20220311163133.668809-1-tromey@adacore.com> From: Luis Machado In-Reply-To: <20220311163133.668809-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0038.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::6) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 14dddb93-8985-4a37-c4d6-08da059d5736 X-MS-TrafficTypeDiagnostic: AM0PR08MB5362:EE_|VE1EUR03FT060:EE_|AM6PR08MB2951:EE_ X-Microsoft-Antispam-PRVS: 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: ZLNKmNkfo1qs1oc6I4ygOQzAT8wyeS8BiK7VtxwJvMI1eq9qTMTxViRefIj4t2gVP9nbtFNAkXcXYJwo7oBu1ENCf84QRfPGR5Sg1YLq5fE/0HXbcDxrTEusQlwqt9HFnTCwlyxY00Tb8CIm1NKTDQYpm4vcYzQburKR9PtRhqvufXU1vwzBMAOk8TsSNVgFk1mEsLasXWPmn8nInZB6nFyZTIySkThqi1Zr/mTFZT7G4aFuOkaBJPZOdBn4RVBeUV1snIjtMAGETGnoBTIWhuTmJOiEPW3Hkw4TtBePlOvWYuwZPTrs/xQK9RFKhCacfiaUqgj/eudVRfKJWB+d+Tm6UppxqOlT3usP/+sziYhGmPfWvqkCQgX1eHU2yGLS5Omy4jybGHkr0qPzLZJ7oBk/XIPwzZ/LT0w6zjgLl9XsczQ36gU3p6G25SbAV/D86RM35qBVfikiYxT8F2hE5bBy5kxddzu7/TSskUMPJuURElqEGPmXz6uEKXnDMg8zg4i5jnqYIjviAm/Tlr3bNBuxcr0Sy5JuKuunFHmbfjwsP5NSlhZDkzWbpY0DqhUZu+7OxKb9nskhVV+AgnxC44VVG3E1OnErO0Ku7fBsD4pNHcwNpisr7KncCU/X/CpZzqKz8eIGh0uny/vofeznLivZ8kKRt1bFhUpsKyouw3UNbGmy81DEB12Nfdw9MoTHbninYxA9qWPXr/nHT0wPUa20gxrIIGN/DFAlLpBF9h8= 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:(13230001)(4636009)(366004)(2616005)(8936002)(66476007)(66556008)(66946007)(508600001)(53546011)(6506007)(31686004)(26005)(5660300002)(38100700002)(186003)(6512007)(44832011)(6486002)(36756003)(2906002)(31696002)(83380400001)(316002)(8676002)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5362 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: VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4150cc1d-1f0d-4ac8-ec43-08da059d45a3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bYQE9P48eRnvsvmBHz6QPVk2BQuvK6KUVT2HiggYTUsvBZumrun+x3VFaVXtHN9Q8FUtfIho7JVASaij0lMPvdM1kbiSjID/UzX9YpZdCB8bpVcuDZQge6Vm3skK1HS9aQbH/JcahWo14ZTp+2nHZnBgDsT7WktupL/mxfVKsptfQJnsb3OS31U5ZgoTAOmZj5PtmK/iehh5CVM49Wyn+FZyquhHvKu7GfVEoUm8J40wrJU4UiD0kCWC4OAv4qs4X/7FsKZlVg+QSexmZqy0+MtNDQZWsVCjIwdEIhvvmuVyWLLot2Hn3XSgUJHQh+jgNBg7r+rCUU7uG/+V7GL2Xw/CucobTfYPRRCz4DlaXgmMgFOutrlVqGlorZuLxeip4dA6hgzZzGb51TZ/l74M21HVeTL4NW7SqzYvOkVoEtWIKt8J3fqAdi+0spxZ2wMSwqaOhNWs70n00kSM8w1KI6HBOO63N9hSREYRuTbwCZUmPZrIJGzhjGSpbU/fEGzAkjuA10YGFANompDUbK6qQC8H7zoeK7uVH2YPrPRI7jGsZxu6dZTlFsgkbjyBnDd5++hs/p56iokFFOoExIC6m3wfaQzLc33kXghTYOCNJofgp/r77lMINoNEnF0GpGt2Omrz++sXV162gwC/+oJU5RivqYbBXiZOt2pcxFzYhmAku7JHrzeDghNqMWg6py43Cg1PfOCXhSjDQ053I8mIAg== 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:(13230001)(4636009)(36840700001)(40470700004)(46966006)(6506007)(83380400001)(53546011)(40460700003)(2616005)(36860700001)(356005)(81166007)(6512007)(5660300002)(31686004)(2906002)(44832011)(8936002)(36756003)(86362001)(70586007)(70206006)(47076005)(31696002)(6486002)(508600001)(336012)(26005)(186003)(316002)(82310400004)(8676002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2022 09:30:55.6479 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14dddb93-8985-4a37-c4d6-08da059d5736 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: VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2951 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 14 Mar 2022 09:31:01 -0000 Hi Tom, Thanks for the patch. On 3/11/22 16:31, Tom Tromey via Gdb-patches wrote: > The internal AdaCore testsuite has a test that checks that an > out-of-scope watchpoint is deleted. This fails on some aarch64 > configurations, reporting an extra stop: > > (gdb) continue > Continuing. > > Thread 3 hit Watchpoint 2: result > > Old value = 64 > New value = 0 > 0x0000000040021648 in pck.get_val (seed=0, off_by_one=false) at [...]/pck.adb:13 > 13 end Get_Val; > > I believe what is happening here is that the variable is stored at: > > DW_AT_location : 2 byte block: 91 7c (DW_OP_fbreg: -4) > > and the extra stop is reported just before a return, when the ldp > instruction is executed: > > 0x0000000040021644 <+204>: ldp x29, x30, [sp], #48 > 0x0000000040021648 <+208>: ret > > This instruction modifies the frame base calculation, and so the test > picks up whatever memory is pointed to in the callee frame. > > Implementing the gdbarch hook gdbarch_stack_frame_destroyed_p fixes > this problem. > > As usual with this sort of patch, it has passed internal testing, but > I don't have a good way to try it with dejagnu. So, I don't know > whether some existing test covers this. I suspect there must be one, > but it's also worth noting that this test passes for aarch64 in some > configurations -- I don't know what causes one to fail and another to > succeed. Are the passing/failing runs using different compiler versions? If the variable no longer exists, then having a stale location like that seems wrong. Can you pinpoint what is different from a passing test and a failing one? GDB version, compiler version, different binary? These hooks seem to take care of functions without debuginfo, so they tend to walk instruction by instruction to figure things out. I don't have a problem with the patch itself, and I don't see regressions on aarch64-linux. But I'd like to understand if the compiler is possibly generating something that it shouldn't.