From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150074.outbound.protection.outlook.com [40.107.15.74]) by sourceware.org (Postfix) with ESMTPS id D44893858D3C for ; Wed, 18 May 2022 09:54:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D44893858D3C ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jKUaL39LDk46ZpwGBvkyTIC9y924pyUuyGUNmmPT9QaZwClFmamzU9ABPq94ralA3mjkRcHcj0QHlIIXrcE3o/F5c8NuFJYWQwf/qrIXAyFmOHXwbPJ+0xHkHMzzbl3etLNHjFgvo5C65mIwU5HAEVSgh9B7Z496BnNS5XWLAQuk/FVOoFkq4GfzATS83H5qZ7yQcSibDWpze+h/DLyodxwth/VJiFD+vrJhMLMLRQbTDdQHDmvCE9VyZmsgqHELdqQM9Eu5SCOrW4tkQiYmnWpojB/pWPKFbadcbGiZTlllySSysOGwG9/cqSMNEOXuecrct5T87N/uwYRTIYrfuw== ARC-Message-Signature: i=2; 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=06eR7WSTHxdWh/4WdI/f6V8nxeR7Z+F95sFnpQyQt2I=; b=ZQWWcg5Au4QfEHxyvehDkCUkBLYQEdTy/n/rc3QICmmNN4/CioPaPP9ErpOfRVieYWISaCTZMzbSbbfJDDVtGLmSGiWvqVuhtjIzBebA3/eWLUWOZQYQsqh0Wf9sWNhj2d0M5xaugEa7O83IDwRjXqu/kw+82V+lsDsNeykC81Za+GPO8eHzGA8XBeehowlSnNbZ34OpdMIQL1GqZIIQH+H82+6Vabg8egDiH+9e78Eo0Ku2N0SwqyyRde1WddayqsPxHLtRZkqkoS6vJKz/H5bXUm6p9Ff9T74+1815do7KrioT0wbqRJ0aDCoeGzbu+iMbmfFi2yogM+XzznXpIw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AM5PR04CA0034.eurprd04.prod.outlook.com (2603:10a6:206:1::47) by DB7PR08MB3226.eurprd08.prod.outlook.com (2603:10a6:5:22::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Wed, 18 May 2022 09:54:10 +0000 Received: from VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:1:cafe::ab) by AM5PR04CA0034.outlook.office365.com (2603:10a6:206:1::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Wed, 18 May 2022 09:54:10 +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 VE1EUR03FT048.mail.protection.outlook.com (10.152.19.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Wed, 18 May 2022 09:54:10 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Wed, 18 May 2022 09:54:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4f9d5a271a722b64 X-CR-MTA-TID: 64aa7808 Received: from 387e41936faf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D81390AF-20EE-46AF-A2F0-18ED541CAEBB.1; Wed, 18 May 2022 09:54:03 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 387e41936faf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 May 2022 09:54:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JNHzbcbF4MCVM0sYbRQNtabwIzw7USSaIFboj9QZ240Zv8hvVOwlVQ7NgiJCko2IIOrRNHA5Ws/TN/3+jozTlLw/ufx8DvWqEXEvk2XgfrSiGXOXkfntOe25yBTlgkoha4wKR1aEkddHrO2oeoX+6SXLswMDXipJba4ryMc0qvq93Lq7HmL8Cltg8x6V2sG6p7crvVXktDbNc4xJ5UQ4mAVWOTTXFzEkrNMKcx+UuupYG0fnaTvrkx49yttIe1eRuWKGyEIfPHK8uvYGULsadf1cU/vYBon0AezzQoOXjDZg/VmRJ87s9Y8wJNBefYKBB/6/7LJe539Pp+vecfPCgw== 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=06eR7WSTHxdWh/4WdI/f6V8nxeR7Z+F95sFnpQyQt2I=; b=Ao6Zfl55NJ/hmdIY99mnQM2SX3kJE/5Dp70UkJkCw/0gsVe43aeSbvYb0V1vtt8jHlfahREK3gbvmmKmoR+6CvEsQLjc4065NImv+pHpU4oUVMgkISwdF7j2DKBx2qmowdGusZBnTS7RZuhsvDncrXLRCgj/Y+08WO9hMCen+XwKlWIPx7qtadxdcWS6g9cL1+GiVnavpM9dssoWbMJ2oGeAtYICrgJx1khuP/KJi6H2MBoGUYp89lpes+HDpHiG9cP85UK7UBf+zvXkUfqgw8R7PACIB4ZHOZs3s4sjcaNaoPn/0m+4y4GJTLOhwPngbBcmrD8GBIAsZCDrmFwPMQ== 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 AM0PR08MB4563.eurprd08.prod.outlook.com (2603:10a6:208:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Wed, 18 May 2022 09:54:01 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6%7]) with mapi id 15.20.5250.018; Wed, 18 May 2022 09:54:01 +0000 Message-ID: <8d311bd0-d814-934f-8639-8841a10c803d@arm.com> Date: Wed, 18 May 2022 10:53:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3] Return the regnum for PC (32) on aarch64 Content-Language: en-US To: Yichao Yu , gdb-patches@sourceware.org References: <20220517173650.844755-1-yyc1992@gmail.com> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR11CA0001.namprd11.prod.outlook.com (2603:10b6:806:6e::6) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5cf3005f-aee3-405f-85a4-08da38b45b4f X-MS-TrafficTypeDiagnostic: AM0PR08MB4563:EE_|VE1EUR03FT048:EE_|DB7PR08MB3226: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: X+OQZ7zLwLW9kKe39W0SiOe0vrnREO1Msr5KJo0DCPTGtFcARrEx+0F/UhmcfXMLGefxzot7rpbFqqQOvWna6fgWRCh0ERxloxYdoYupkWcf2qCSTxAXZHnDuL/PNq5UWjTey9kkJ11Jxj7bCW1xVGq8gEvUqh0uV5lEcws99OHjYRSlDXBDmRCZj5pMPMTq4LHEjM7dxsOk/xseMxseRKvmFKUxc1jjbwgHNjDg05uKtlXDoB96uhrGnUoFGoH1rEffO3s8jjuu+0jbpgu/EoK433dBAohhU/t8KGQOW4FIS3LKFvhdBs9uK8v3ds9bDz+kyiKKqALPHoOykA/a00PKr9dIz7h2EvaYxtG+trx3BjAY6zmOVaiwqaf6W3+qLEMz5uN2z6AiogoSXdQ2BfAJkrBSiYjPhvUKOwx2t/b89qk9ghoUBrwOJHnjvoG/EjNWw2+N24jSsC26bbXYiktp9/FyD2P2AoXR9Zb+qgwKcx2beS1WzKl7BrsKGw4GhC27t4FFc6kxk2jWJPVldZ22rsZy98odDstDq3xZXUIgiXE0wPFOxEdD0BjZyWe554tKfJSbaZqMV2zxnCNqud3oMDRL8VZRwHfAZrQrXJDxo4oxeBDb9z7f8F6u6eqs5vl9fQRQ1DDfh34vvj2PMqooW4l1TYaEIFiqQddZHzlX8CHlSTgTb0Tlg9no49UT3HHq9mWOPuG+z9Z/hIRtcx+wlX12yDdTZMr/Io0ioorvTqd/EQeZUjRX9r/bdXqO4PZeLbyt5FKDWxm8GtNsQBFVpI6nc4QGc0d+QQbd1g6JohttZVeF8FipGzH5LkFMUb1ts+Ng1ER2+ktHJ5aUXPbMmO5vihtceueO3wFtS1I= 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)(86362001)(66476007)(2616005)(53546011)(186003)(38100700002)(6512007)(2906002)(36756003)(31686004)(26005)(66946007)(6666004)(31696002)(8676002)(66556008)(6506007)(5660300002)(83380400001)(508600001)(6486002)(966005)(316002)(44832011)(8936002)(2004002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4563 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: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b8c46755-f60f-43e9-8bde-08da38b455fb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VnNX5LiHFG3b+cAJP7kpSp5xO2VlTi0f7rqOnid/8jVXBZyIAxd7mdUZaFCbiaZ2K9ImqMsbhab7lGN0rnTDIqECy7lifeJGxeftjv2bov6XbikU1tUfpC37UPlk2QiqoiD5VfM1ttHz9TZKFkBqArN40kn3Mf3mmCxVLpnC9tNr/Z29bOtO8ToP5mV6qCMOKggYADtNJImA6qIxFMm7CznSX3StGuhT4XvOBHKIR5Ywi7JZLhu1KBj4/35X5U9h7KAPNo9+RdOuUQAWtZth8wW6Z8Y7adI9bhZHFhEWmSbBBYbIg2UqS8icd00JaQq4MBlA7iaom1tzrcmjoUqtudRDdIvavbPM7o++hBQzfBJMiibBWoVS4sZ/JL7fg4OSLhLqxcbK/nhSlidRMGkGisNcQYrGJ1bMS7SCRRqBSyV//zLRJqlw/E+FuvzeJQF0tfgxr64VwA9G9AxQLTHNO/EaiaFICkTOwCxTp/xtjeC2r0R/aZg/KoGZN2eeNuBIbqnWeYR2xfBvWca/VaGoHn79cRT62IlH+BlbVEt3GmYLIsZb9FbASGp5Uo7056wR566GSCK8KTX2WLFeNSomZY5XIdLxFlVgpfjr+wNy7Xj6T+ckS5yOtsfXdb/GXtO5rS9tmEa4xyWT0D9HdwVyLbsweGRIIZVPQ8+DcZoxPsP+LRzdzNQ4mCZYEk+ylf+vUJh3js3bsTaW7JxUKiiDyTI2bnmZYWSq3lvGQCKx/UMbeflo8+wS7+KS7Ad/VZGbkyL5hhCzHA9CWduziy9yqhzoj1SNBran6GIegIDt7le/6kubM5S40VEs//DkOE6k7+wNPCbejhgHcj7oOG+D7YBtuiPPHZhcDqN1CGNZFRc= 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)(46966006)(40470700004)(316002)(2906002)(40460700003)(36756003)(83380400001)(5660300002)(31686004)(86362001)(47076005)(31696002)(36860700001)(82310400005)(336012)(186003)(356005)(2616005)(966005)(8936002)(70206006)(70586007)(8676002)(44832011)(26005)(6512007)(81166007)(6666004)(6486002)(6506007)(53546011)(508600001)(2004002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 09:54:10.2220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cf3005f-aee3-405f-85a4-08da38b45b4f 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: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3226 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, 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=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: Wed, 18 May 2022 09:54:17 -0000 On 5/18/22 02:03, Yichao Yu wrote: > Sorry for the duplicated post.... I think somehow the university > network prevented the email from going out earlier today... No problem. I've been having some inbound e-mail issues as well. > > On Tue, May 17, 2022 at 8:45 PM Yichao Yu wrote: >> >> This will allow the unwind info to explicitly specify a different value >> for the return address from the link register. >> Such usage, although uncommon, is valid and useful for signal frames. >> It is also supported by aadwarf64 from ARM (Note 9 in [1]). >> >> Ref https://sourceware.org/pipermail/gdb/2022-May/050091.html >> >> [1] https://github.com/ARM-software/abi-aa/blob/2022Q1/aadwarf64/aadwarf64.rst#dwarf-register-names >> --- >> gdb/aarch64-tdep.c | 3 + >> gdb/aarch64-tdep.h | 1 + >> gdb/testsuite/gdb.arch/aarch64-unwind-pc.S | 48 ++++++++++++++ >> gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp | 70 ++++++++++++++++++++ >> 4 files changed, 122 insertions(+) >> create mode 100644 gdb/testsuite/gdb.arch/aarch64-unwind-pc.S >> create mode 100644 gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp >> >> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c >> index 9d06ebfe27c..f9eb455232f 100644 >> --- a/gdb/aarch64-tdep.c >> +++ b/gdb/aarch64-tdep.c >> @@ -2219,6 +2219,9 @@ aarch64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) >> if (reg == AARCH64_DWARF_SP) >> return AARCH64_SP_REGNUM; >> >> + if (reg == AARCH64_DWARF_PC) >> + return AARCH64_PC_REGNUM; >> + >> if (reg >= AARCH64_DWARF_V0 && reg <= AARCH64_DWARF_V0 + 31) >> return AARCH64_V0_REGNUM + reg - AARCH64_DWARF_V0; >> >> diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h >> index e4cdebb6311..aa1bedbdac6 100644 >> --- a/gdb/aarch64-tdep.h >> +++ b/gdb/aarch64-tdep.h >> @@ -34,6 +34,7 @@ struct regset; >> /* AArch64 Dwarf register numbering. */ >> #define AARCH64_DWARF_X0 0 >> #define AARCH64_DWARF_SP 31 >> +#define AARCH64_DWARF_PC 32 >> #define AARCH64_DWARF_PAUTH_RA_STATE 34 >> #define AARCH64_DWARF_PAUTH_DMASK 35 >> #define AARCH64_DWARF_PAUTH_CMASK 36 >> diff --git a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.S b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.S >> new file mode 100644 >> index 00000000000..6cc4f80e349 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.S >> @@ -0,0 +1,48 @@ >> +/* Copyright 2022 Free Software Foundation, Inc. >> + >> + This file is part of GDB. >> + >> + This program is free software; you can redistribute it and/or modify >> + it under the terms of the GNU General Public License as published by >> + the Free Software Foundation; either version 3 of the License, or >> + (at your option) any later version. >> + >> + This program is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + GNU General Public License for more details. >> + >> + You should have received a copy of the GNU General Public License >> + along with this program. If not, see . */ >> + >> + .text >> + .globl main >> + .type main,#function >> +main: >> + .cfi_startproc >> + stp x29, x30, [sp, -16]! >> + .cfi_def_cfa sp, 16 >> + .cfi_offset x29, 0 >> + .cfi_offset x30, 8 >> + bl test_func >> + ldp x29, x30, [sp], 16 >> + .cfi_restore x29 >> + .cfi_restore x30 >> + .cfi_def_cfa sp, 0 >> + mov x0, 0 >> + ret >> + .cfi_endproc >> + >> + .globl test_func >> +test_func: >> + .cfi_startproc >> + // Unwind x30 to a different value >> + // CFA_val_expression x30 const2u 0x1234 >> + .cfi_escape 0x16, 30, 0x03, 0x0a, 0x34, 0x12 >> + // CFA_val_expression pc breg30 0 >> + .cfi_escape 0x16, 32, 0x02, 0x8e, 0x00 >> + mov x0, x30 >> + .cfi_register 32, x0 >> + mov x30, 0x1234 >> + ret x0 >> + .cfi_endproc >> diff --git a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp >> new file mode 100644 >> index 00000000000..105b9a9cc3a >> --- /dev/null >> +++ b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp >> @@ -0,0 +1,70 @@ >> +# Copyright 2022 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +# This file is part of the gdb testsuite. >> + >> +# Test explicitly unwinding the PC DWARF register on aarch64 >> + >> +if {![is_aarch64_target]} then { >> + verbose "Skipping ${gdb_test_file_name}." >> + return >> +} >> + >> +standard_testfile .S >> + >> +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { >> + return -1 >> +} >> + >> +if ![runto_main] { >> + return -1 >> +} >> + >> +proc test_reg_vals {} { >> + gdb_test "p \$pc - &main" "= 8" "p \$pc" >> + gdb_test "p/x \$x30" "= 0x1234" "p \$x30" >> +} >> + >> +proc test_unwind_pc { inst } { >> + gdb_test "si" "$inst" "single step" >> + gdb_test "backtrace" \ >> + ".*#1.*in main ().*" \ >> + "backtrace" >> + gdb_test "up" "in main ().*" "parent frame" >> + test_reg_vals >> +} >> + >> +# Ready to enter the function >> +gdb_test "si" "bl test_func" "call site" >> +# Step through the 3 instructions in the function to make sure that >> +# we have the same unwind info throughout. >> +with_test_prefix "1st stepi" { >> + test_unwind_pc "mov x0, x30" >> +} >> +with_test_prefix "2nd stepi" { >> + test_unwind_pc "mov x30, 0x1234" >> +} >> +with_test_prefix "3rd stepi" { >> + test_unwind_pc "ret x0" >> +} >> +# Check again after we returned >> +with_test_prefix "final" { >> + # Check that we've stepped out (si prints out the new function name) >> + gdb_test "si" ".*main *().*" "single step out" >> + gdb_test "backtrace" \ >> + "#0\[\t \]+main ().*" \ >> + "backtrace" >> + test_reg_vals >> +} >> -- >> 2.36.1 >> Thanks. This LGTM for aarch64. Please push it.