From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by sourceware.org (Postfix) with ESMTPS id 191D63858C2D for ; Mon, 27 Nov 2023 11:53:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 191D63858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 191D63858C2D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.20.66 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701086021; cv=pass; b=W1DDu0y7nnCAeL0FvyR5pz730vEqgNUthWmxn5gr9UhPbRckXcOf93sm4AZDABtukNJzmuBpzjhG/G+fFKdfH3kZjWG5Os0dtVzLqR+qasY05dBJOzdG1iQP+6jDQ/17qSNdGLxD7IGhgcuJRCy1aS9DRmSthknofmbbeaFsax4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701086021; c=relaxed/simple; bh=x9XxbmKB91wNRAn8R0OCJXGBP+tA08RjMmp8uRmOcEU=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:From:Subject:To: MIME-Version; b=WxFoLhFpJABU31V8NlzpRFuGHdMqKxOR9kZCjXu3nEy7pobBBn2dFcR7st/yZom5UGpl2ngUNp2dzdgwZ9skdXhY3dSNa72cPAGaYsuTx6GxFCF9vo9Ln7LVmQ2WXlE5ALSjFU1/LuJUG4mLW5HCubq/auMTLCMjQsQgExcfaP0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Yo+Y2UEGJOvTokbI1yhNc8UObAynrEuiJrv1YBx0LKfIQ05dU2YSiUBWO31JanQ3PWUgsA3Ctn3O3q7+tIw9vE2y6+loKXkbwW6Tq/VMHhtyl2q95Ytv+HDZar69zcgDOoUo/9jZdFnbXFcWQiHk5bt3AN9C6CMZP92m+pKAvghgDZ8BjQNdz1Ra5h2idP0Ay2qxcLg3FFPrUclSzrWURK3SpxLa7EFn0qcxrBSHdjlL3h3Qf5ujEeSlJfQhDhF1FCXVFUG0Nh7niIbIeNKHw2rK50Napr5+uoB+oAg/giLf6yosc0G8lAYQPbYkuDDeVyfg93CgKg/ZEt9b3lrKUg== 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=EVV8p/PBIHKUeIdE/UP0ByaBvzDx1hZdLT3roI82W4E=; b=QJvcp7sSJXd/Sdn1iwsTy7jGHF5g7Eu/hxg6+loBGjZh5DHNNR4ZoxsyGuDWEyGxPEoRuc73i4owsdzy0GHj5rpfojZJ6cx+VDhWn1uHX4pKcOp7/etzD7jk0rxWB1BZW96NSSvaTNNyMCxhudynVHQI0XhPN7LLaEwZIh2L6aZrVfIw22H72rbtQg05hXrQneUhzTSYOk0bvMpUOgtswUzltERuKPC4OYba2AGUeOsWYc7vQkeB5qEbx8zIHFNYQP+CCHY8etTyu/nUQSe/nv5YviC67eBs2h3vHNRvP4XouMxh/eA7aLUG66sCT6eKj9PDwQDLM/rJ+4BGQ/oZDw== 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]) 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=EVV8p/PBIHKUeIdE/UP0ByaBvzDx1hZdLT3roI82W4E=; b=hrbVzHgAQ6IXhkaqNUc6G/WHvRTRolS15AyNL0GuGUcR47jDyW0c1ZiKh2fcLZLgjD2ELbBtomlTfJPmLFovXwq6Nmd/eApl8eYdDIf4hkgKslV3+lVvO9vdqB5byrSXmtK+zDdx16JewCW+a5EjY1QSNFweqk7XSQanSff55dU= Received: from AM6PR01CA0072.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::49) by AS4PR08MB7601.eurprd08.prod.outlook.com (2603:10a6:20b:4ff::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 11:53:32 +0000 Received: from AM2PEPF0001C711.eurprd05.prod.outlook.com (2603:10a6:20b:e0:cafe::b9) by AM6PR01CA0072.outlook.office365.com (2603:10a6:20b:e0::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.26 via Frontend Transport; Mon, 27 Nov 2023 11:53:32 +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 AM2PEPF0001C711.mail.protection.outlook.com (10.167.16.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 11:53:32 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Mon, 27 Nov 2023 11:53:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ff8e95878b0ce51f X-CR-MTA-TID: 64aa7808 Received: from 133ad4239678.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FEE51CDE-FE00-4BBC-BB13-84D0EFBC1222.1; Mon, 27 Nov 2023 11:53:26 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 133ad4239678.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 27 Nov 2023 11:53:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jjae6yyzkYQYLh4CX0PdN5SLKMSCw0yfCHEq+Et59n7OCf9NAT5+bfEg1tGSHKoFqKRofY7uZ3qedv7ELtGjBwcuL5zERfESHqsVIM9Bpb8vxSRaw4rozv9aTQfExbsz23I0HJ6nDzDG8fFuWHuh427gL2+qceHXLDJGOXMX0sx3K7HRkIzByJliITCH9kfVc01IQ7x9PJOWMWw92oe4qhSxWw0/bNEeQaEb9lBd4yJVFr0YK/mp376g42FxgoWI4Ow2gzD8+7FQJedfIDUk69NYbFptWpdo2AJWqT5uMovVaJTePTWdQE+ssBpNDJAU/vVt76wewmOqrcaDVfi/MA== 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=EVV8p/PBIHKUeIdE/UP0ByaBvzDx1hZdLT3roI82W4E=; b=E5WOyCVV8sGk7n+73IN9v6YqIpxrpZ97tllI992f8KO9EX6I3yX099tLZ4tYivgvQEIFgjqv+3IMy+RSeED66s+dmDs98c4o1Rss94B4rY31Ze2igrONgTPfv7BDshWuNHHb8ro/CiKcepW5IrDFdj/KRqKSBMZEhQETRyidkoZZeXdTpSiiHFSb70pksLmYaAKJHXCQoR1EMsOvq6FuNhjFzzipn4akSrs1G/ABVYt88D1rwWVAVCVfpnYCQbj9ZsK6Jn31OECQp3JZFDbrkT/aUnVqy04wqxVDN5vdLo0t/7s7kkpRIRdW3uFiZWlQQWAt5wbaSsdkdWLC29wsdg== 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=EVV8p/PBIHKUeIdE/UP0ByaBvzDx1hZdLT3roI82W4E=; b=hrbVzHgAQ6IXhkaqNUc6G/WHvRTRolS15AyNL0GuGUcR47jDyW0c1ZiKh2fcLZLgjD2ELbBtomlTfJPmLFovXwq6Nmd/eApl8eYdDIf4hkgKslV3+lVvO9vdqB5byrSXmtK+zDdx16JewCW+a5EjY1QSNFweqk7XSQanSff55dU= 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 PAWPR08MB9664.eurprd08.prod.outlook.com (2603:10a6:102:2e4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 11:53:23 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51%4]) with mapi id 15.20.7025.022; Mon, 27 Nov 2023 11:53:23 +0000 Message-ID: Date: Mon, 27 Nov 2023 11:53:18 +0000 User-Agent: Mozilla Thunderbird From: Luis Machado Subject: Re: [PATCH v2 24/24] gdb/testsuite: add tests for unwinding of pseudo registers To: Simon Marchi , gdb-patches@sourceware.org Cc: John Baldwin , Andrew Burgess , Simon Marchi References: <20231124212656.96801-1-simon.marchi@efficios.com> <20231124212656.96801-25-simon.marchi@efficios.com> Content-Language: en-US In-Reply-To: <20231124212656.96801-25-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0222.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::18) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|PAWPR08MB9664:EE_|AM2PEPF0001C711:EE_|AS4PR08MB7601:EE_ X-MS-Office365-Filtering-Correlation-Id: a9af5390-7d27-4494-e241-08dbef3f7aed 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: 70Cg30zXLS8crwAvC50acf6zqS4HukLgCGYyn98c53ZedVgryBzN7DhdFDlbtar+JSoi/6919vGEvbmmxGIB2ADGEFdDbkUlYk4bz1uoAK5pasLe4e+kRQBKVBQkuKxGv5M5tzO+XD+egCaVtMXa8EYsYpA8J01lIB61H03RlNxhmOtFMUXQoRjwyfNeDfOGdW2+/pjkFgTpiwwJ0Yv3TuRQPskTLCv88m2rq97Wd8zDbYeV8oPuv7J2jsIKdesn2kezWB/4/qn0EUdVW8QOek7NCxIINhqjkhRhcD0OZtSCPhd9U8RmVZnbbJp5qPsQxGyNs202ipNR29QDIxfft/LBEX5o9L9M8ed9E4UR4/caixn1k4iZgTwzyLlA1But60dG1dtLUz9QT2NJR9qB7AMxmFYn/ajexA2+movxEP0qcxl2VNiR3nreYQFnBg0JeO0MSDhyCbZVdin3QhQglIalAUaH+QPfxkNYSKhVyo2aT+dv2BMiMFbv2N9LM196K+Bv2aIzZdx5hjnTzWC/wxKAhcqmP5OC5hWRLzTQDbexQyf1dkdwDzJ3Q8ZjRySpic2JqUGIdruG9wJGaEYEqXtrAiaFeEa81LxT8b3mcm6nHgOd7Rxb3n6KU73zPbSHgaxhwf0T0aISE5IjD/8T8cr6rCJEju38F8lQGsOWl6CFumj1oF1xjk6I/590Lsyv 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:(13230031)(346002)(366004)(39860400002)(136003)(376002)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(6512007)(6506007)(53546011)(2616005)(6486002)(478600001)(6666004)(966005)(83380400001)(30864003)(2906002)(44832011)(5660300002)(41300700001)(66946007)(54906003)(4326008)(66476007)(316002)(8936002)(8676002)(66556008)(38100700002)(86362001)(31696002)(36756003)(31686004)(26005)(2004002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9664 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: AM2PEPF0001C711.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 21cc13af-582e-47bf-2a69-08dbef3f7549 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BYhOKEa6gelF916NEJaUY4z5fwndfnH6EBGEgcf2pjDcPWFGVZ0z11j+OYZGhEWspd6f/KAP6QZHw0TvWcNNgK8wAxmJEReY/PhzMgHgU1wC+vYl27ov7rY7cMiDjTE9cbNDJjmpJBVKCZJvS8dNpLXWRdNPHC15Ps1tmmPO2jnzrzWArGDDhvEG14SZ6AogGkRCyNWOuQQVjzEzL0z1u1AvJ/Lik1N+FUO0W2NgEMqSN2Q7wF3lTzpNwyYoMCtR+sxuQezG/e2Gf382XsIcbDUlI5erK3J7hUE/UZxrQPwRZ4/fPflZOhBmHlM8cTI8+vJiT516dOfdQZW+4VerAVtlSw4wv6kulcyrlOwUpxIz7XZpTQkNpuqGHbhMHaE+QeT4nt+IGEywc5r5Uk9KkeAenlkceW/PctIJSpMdPMDc8S+4YuSlyZFa0sbUw0Mu1JHleIN+KvkMg04dY5v7n6ImlRNUIh5dLiynV/8FVlkn0OKQqUoLLGYFIX4/B4WXMLswxNSNjbL8YnXGSkSD+R8KORgrLr/EFvRR0hthmMlKNmtopLPmIbscswEPQ3cKWnQT8IsF6Y4FHTrnmpOpq7q6oRvhA2CKfSye0F7qp+Jp4tLFSHwOGwILiKcQdIOGib8oqof+qXBSNc6UgtU84Rew9eZfnWljSoI2BoFtsEZZ9ddVvzTlTDeO3dprPfrjbS5n+bRERAcL5k6g657z9oTjTGiNRJIGXxuQDsMDy7WEssTbMANG+t8kzEdJEBXIUdaFm7kh09Js363u95J/YIiN5tt012aMBwx97YSOjyZhemMwhxJQO6jB4rkz8O/L 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:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230922051799003)(64100799003)(82310400011)(1800799012)(451199024)(186009)(46966006)(36840700001)(40470700004)(41300700001)(36756003)(31686004)(81166007)(47076005)(356005)(30864003)(2906002)(83380400001)(82740400003)(5660300002)(336012)(26005)(86362001)(107886003)(40480700001)(2616005)(36860700001)(44832011)(6512007)(53546011)(6506007)(8936002)(8676002)(31696002)(6666004)(4326008)(40460700003)(478600001)(6486002)(966005)(70206006)(316002)(54906003)(70586007)(2004002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 11:53:32.6820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9af5390-7d27-4494-e241-08dbef3f7aed 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: AM2PEPF0001C711.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7601 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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 List-Id: On 11/24/23 21:26, Simon Marchi wrote: > From: Simon Marchi > > New in v2: > > - Switched to using x19/w19 in the aarch64 test > > This patch adds tests to exercise the previous patches' changes. > > All three tests: > > - aarch64-pseudo-unwind > - amd64-pseudo-unwind > - arm-pseudo-unwind > > follow the same pattern, just with different registers. > > The other test, arm-pseudo-unwind-legacy, tests the special case where > the unwind information contains an entry for a register considered a > pseudo-register by GDB. > > Change-Id: Ic29ac040c5eb087b4a0d79f9d02f65b7979df30f > Reviewed-By: John Baldwin > --- > .../gdb.arch/aarch64-pseudo-unwind-asm.S | 82 +++++++++++++++++ > .../gdb.arch/aarch64-pseudo-unwind.c | 33 +++++++ > .../gdb.arch/aarch64-pseudo-unwind.exp | 88 ++++++++++++++++++ > .../gdb.arch/amd64-pseudo-unwind-asm.S | 66 ++++++++++++++ > gdb/testsuite/gdb.arch/amd64-pseudo-unwind.c | 33 +++++++ > .../gdb.arch/amd64-pseudo-unwind.exp | 91 +++++++++++++++++++ > .../gdb.arch/arm-pseudo-unwind-asm.S | 79 ++++++++++++++++ > .../gdb.arch/arm-pseudo-unwind-legacy-asm.S | 84 +++++++++++++++++ > .../gdb.arch/arm-pseudo-unwind-legacy.c | 33 +++++++ > .../gdb.arch/arm-pseudo-unwind-legacy.exp | 86 ++++++++++++++++++ > gdb/testsuite/gdb.arch/arm-pseudo-unwind.c | 33 +++++++ > gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp | 88 ++++++++++++++++++ > 12 files changed, 796 insertions(+) > create mode 100644 gdb/testsuite/gdb.arch/aarch64-pseudo-unwind-asm.S > create mode 100644 gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp > create mode 100644 gdb/testsuite/gdb.arch/amd64-pseudo-unwind-asm.S > create mode 100644 gdb/testsuite/gdb.arch/amd64-pseudo-unwind.c > create mode 100644 gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind-asm.S > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy-asm.S > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind.c > create mode 100644 gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp > > diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind-asm.S b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind-asm.S > new file mode 100644 > index 000000000000..575ed75ae9f5 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind-asm.S > @@ -0,0 +1,82 @@ > +/* Copyright 2018-2023 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 . */ > + > +.section .note.GNU-stack,"",%progbits > + > +.data > +value_callee: > +.quad 0x2021222324252627 > +value_caller: > +.quad 0x1011121314151617 > + > +.text > +.global callee > +callee: > + /* Standard prologue: > + - push fp (x29) and lr (x30) to the stack. > + - mov sp to fp */ > +.cfi_startproc > + stp x29, x30, [sp, -16]! > +.cfi_def_cfa 29, 16 > +.cfi_offset 29, -16 > +.cfi_offset 30, -8 > + mov x29, sp > + > + /* Save caller's x19 value on the stack. */ > +.cfi_offset 19, -32 > + str x19, [sp, -16]! > + > + /* Put our own x19 value. */ > + adr x0, value_callee > + ldr x19, [x0] > + > +break_here_asm: > + > + /* Restore caller's x19 value. */ > + ldr x19, [sp], 16 > + > + /* Standard epilogue: > + - pop fp (x29) and lr (x30) from the stack */ > + ldp x29, x30, [sp], 16 > + ret > +.cfi_endproc > + > + > +.global caller > +caller: > + /* Standard prologue. */ > +.cfi_startproc > + stp x29, x30, [sp, -16]! > +.cfi_def_cfa 29, 16 > +.cfi_offset x29, -16 > +.cfi_offset x30, -8 > + add x29, sp, 0 > + > + /* Put our own x19 value. */ > + adr x0, value_caller > + ldr x19, [x0] > + > + /* Call callee. */ > + bl callee > + > + /* Store our x19 value in x0 to return it. */ > + mov x0, x19 > + > + /* Standard epilogue. */ > + ldp x29, x30, [sp], 16 > + ret > +.cfi_endproc > diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.c b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.c > new file mode 100644 > index 000000000000..d18876fe3be3 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.c > @@ -0,0 +1,33 @@ > +/* Copyright 2018-2023 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 . */ > + > +#include > + > +uint64_t caller (void); > + > +static void > +break_here_c (uint64_t value) > +{ > +} > + > +int > +main (void) > +{ > + uint64_t value = caller (); > + break_here_c (value); > + return 0; > +} > diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp > new file mode 100644 > index 000000000000..62b3f8c4337c > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp > @@ -0,0 +1,88 @@ > +# Copyright 2018-2023 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 test is equivalent to amd64-pseudo-unwind, but specific to AArch64. We > +# use the raw register x19 which is 64 bits long and pseudo register w19, which > +# is the bottom half of x19. > + > +if { ![istarget aarch64-*-* ] } { > + verbose "Skipping aarch64 pseudo register unwind." > + return > +} > + > +standard_testfile aarch64-pseudo-unwind.c aarch64-pseudo-unwind-asm.S > + > +if { [prepare_for_testing "failed to prepare" ${testfile} \ > + "${srcfile} ${srcfile2}" {debug}] } { > + return -1 > +} > + > +clean_restart ${binfile} > + > +if ![runto_main] then { > + fail "could not run to main" > +} > + > +gdb_breakpoint break_here_asm temporary > +gdb_continue_to_breakpoint "continue to callee" > + > +# Verify the value of x19/w19 in the inner frame (callee). > +with_test_prefix "callee, before change" { > + gdb_test "p/x \$x19" " = 0x2021222324252627" > + gdb_test "p/x \$w19" " = 0x24252627" > +} > + > +# Verify that we can change the value of the pseudo register (w19) in the inner > +# frame (callee). > +gdb_test_no_output "set \$w19 = 0x34353637" > + > +# Verify the value of x19/w19 in the inner frame (callee) after the change. > +with_test_prefix "callee, after change" { > + gdb_test "p/x \$x19" " = 0x34353637" > + gdb_test "p/x \$w19" " = 0x34353637" > +} > + > +# Go up one frame (to caller) and do the same. > +gdb_test "up" > + > +# Verify the value of x19/w19 in the outer frame (caller). > +with_test_prefix "caller, before change" { > + gdb_test "p/x \$x19" " = 0x1011121314151617" > + gdb_test "p/x \$w19" " = 0x14151617" > +} > + > +# Verify that we can change the value of the pseudo register (w19) in the outer > +# frame (caller). > +gdb_test_no_output "set \$w19 = 0x44454647" > + > +# Verify the value of x19/w19 in the outer frame (caller) after the change. > +with_test_prefix "caller, after change" { > + gdb_test "p/x \$x19" " = 0x44454647" > + gdb_test "p/x \$w19" " = 0x44454647" > +} > + > +# Go back to frame 0 (callee), check that the change to the outer frame didn't > +# mess up anything there. > +gdb_test "down" > +with_test_prefix "callee, after change in caller" { > + gdb_test "p/x \$x19" " = 0x34353637" > + gdb_test "p/x \$w19" " = 0x34353637" > +} > + > +# Verify that the value of the saved x19 we changed is correctly seen by the > +# inferior. > +gdb_breakpoint break_here_c temporary > +gdb_continue_to_breakpoint "continue to break_here_c" > +gdb_test "p/x value" " = 0x44454647" > diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind-asm.S b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind-asm.S > new file mode 100644 > index 000000000000..c306b82e4864 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind-asm.S > @@ -0,0 +1,66 @@ > +/* Copyright 2018-2023 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 . */ > + > +.section .note.GNU-stack,"",%progbits > + > +.text > +.global callee > +callee: > + /* Standard prologue. */ > +.cfi_startproc > + push %rbp > +.cfi_def_cfa rbp, 16 > + mov %rsp, %rbp > + > + /* Save caller's rbx value on the stack. */ > +.cfi_offset rbx, -24 > + push %rbx > + > + /* Put our own rbx value. */ > + mov $0x2021222324252627, %rbx > +break_here_asm: > + > + /* Restore caller's rbx value. */ > + pop %rbx > + > + /* Standard epilogue. */ > + pop %rbp > + ret > +.cfi_endproc > + > + > +.global caller > +caller: > +.cfi_startproc > + /* Standard prologue. */ > + push %rbp > +.cfi_def_cfa_offset 16 > + mov %rsp, %rbp > + > + /* Put our own rbx value. */ > + mov $0x1011121314151617, %rbx > + > + /* Call callee. */ > + call callee > + > + /* Store our rbx value in rax to return it. */ > + mov %rbx, %rax > + > + /* Standard epilogue. */ > + pop %rbp > + ret > +.cfi_endproc > diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.c b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.c > new file mode 100644 > index 000000000000..d18876fe3be3 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.c > @@ -0,0 +1,33 @@ > +/* Copyright 2018-2023 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 . */ > + > +#include > + > +uint64_t caller (void); > + > +static void > +break_here_c (uint64_t value) > +{ > +} > + > +int > +main (void) > +{ > + uint64_t value = caller (); > + break_here_c (value); > + return 0; > +} > diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp > new file mode 100644 > index 000000000000..45e9a3c96224 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp > @@ -0,0 +1,91 @@ > +# Copyright 2018-2023 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 test verifies that we can read and write the value of a pseudo register > +# in unwound frames. For the test, we choose one raw register, rbx, and one > +# pseudo register that is backed by rbx, ebx. We have two frames (the inner one, > +# #0 and the outer one, #1) that each set a value for rbx. We verify that we > +# can read both rbx and ebx correctly for each frame, and that when we write to > +# ebx, rbx for that frame is correctly updated. > + > +if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { > + verbose "Skipping amd64 pseudo register unwind." > + return > +} > + > +standard_testfile amd64-pseudo-unwind.c amd64-pseudo-unwind-asm.S > + > +if { [prepare_for_testing "failed to prepare" ${testfile} \ > + "${srcfile} ${srcfile2}" {debug}] } { > + return -1 > +} > + > +clean_restart ${binfile} > + > +if ![runto_main] then { > + fail "could not run to main" > +} > + > +gdb_breakpoint break_here_asm temporary > +gdb_continue_to_breakpoint "continue to callee" > + > +# Verify the value of rbx/ebx in the inner frame (callee). > +with_test_prefix "callee, before change" { > + gdb_test "p/x \$rbx" " = 0x2021222324252627" > + gdb_test "p/x \$ebx" " = 0x24252627" > +} > + > +# Verify that we can change the value of the pseudo register (ebx) in the inner > +# frame (callee). > +gdb_test_no_output "set \$ebx = 0x34353637" > + > +# Verify the value of rbx/ebx in the inner frame (callee) after the change. > +with_test_prefix "callee, after change" { > + gdb_test "p/x \$rbx" " = 0x2021222334353637" > + gdb_test "p/x \$ebx" " = 0x34353637" > +} > + > +# Go up one frame, and do the same. > +gdb_test "up" > + > +# Verify the value of rbx/ebx in the outer frame (caller). > +with_test_prefix "caller, before change" { > + gdb_test "p/x \$rbx" " = 0x1011121314151617" > + gdb_test "p/x \$ebx" " = 0x14151617" > +} > + > +# Verify that we can change the value of the pseudo register (ebx) in the outer > +# frame (caller). > +gdb_test_no_output "set \$ebx = 0x44454647" > + > +# Verify the value of rbx/ebx in the outer frame (caller) after the change. > +with_test_prefix "caller, after change" { > + gdb_test "p/x \$rbx" " = 0x1011121344454647" > + gdb_test "p/x \$ebx" " = 0x44454647" > +} > + > +# Go back to frame 0 (callee), check that the change to the outer frame didn't > +# mess up anything there. > +gdb_test "down" > +with_test_prefix "callee, after change in caller" { > + gdb_test "p/x \$rbx" " = 0x2021222334353637" > + gdb_test "p/x \$ebx" " = 0x34353637" > +} > + > +# Verify that the value of the saved rbx we changed is correctly seen by the > +# inferior. > +gdb_breakpoint break_here_c temporary > +gdb_continue_to_breakpoint "continue to break_here_c" > +gdb_test "p/x value" " = 0x1011121344454647" > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-asm.S b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-asm.S > new file mode 100644 > index 000000000000..0e5ad1b9bee1 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-asm.S > @@ -0,0 +1,79 @@ > +/* Copyright 2018-2023 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 . */ > + > +.section .note.GNU-stack,"",%progbits > + > +.data > +value_callee: > +.quad 0x2021222324252627 > +value_caller: > +.quad 0x1011121314151617 > + > +.text > +.arm > +.global callee > +callee: > + /* Standard prologue. */ > +.cfi_startproc > + push {fp, lr} > +.cfi_def_cfa fp, 4 > +.cfi_offset fp, -8 > +.cfi_offset lr, -4 > + add fp, sp, #4 > + > + /* Save caller's d8 value on the stack. */ > +.cfi_offset d8, -16 > + vpush {d8} > + > + /* Put our own d8 value. */ > + ldr r0, =value_callee > + vldr d8, [r0] > +break_here_asm: > + > + /* Restore caller's d8 value. */ > + vpop {d8} > + > + /* Standard epilogue. */ > + pop {fp, pc} > +.cfi_endproc > + > + > +.global caller > +caller: > + /* Standard prologue. */ > +.cfi_startproc > + push {fp, lr} > +.cfi_def_cfa fp, 4 > +.cfi_offset fp, -8 > +.cfi_offset lr, -4 > + add fp, sp, #4 > + > + /* Put our own d8 value. */ > + ldr r0, =value_caller > + vldr d8, [r0] > + > + /* Call callee. */ > + bl callee > + > + /* Store our d8 value in r0-r1 to return it. */ > + vpush {d8} > + pop {r0} > + pop {r1} > + > + /* Standard epilogue. */ > + pop {fp, pc} > +.cfi_endproc > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy-asm.S b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy-asm.S > new file mode 100644 > index 000000000000..786e79a0543e > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy-asm.S > @@ -0,0 +1,84 @@ > +/* Copyright 2018-2023 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 . */ > + > +/* The difference between this and arm-pseudo-unwind is that here, the CFI > + directives use the obsolete DWARF number for the s16 register (a > + pseudo-register in GDB), whereas arm-pseudo-unwind uses the number for the d8 > + register (the underlying raw register for s16). */ > + > +.section .note.GNU-stack,"",%progbits > + > +.data > +value_callee: > +.quad 0x20212223 > +value_caller: > +.quad 0x10111213 > + > +.text > +.arm > +.global callee > +callee: > +.cfi_startproc > + /* Standard prologue. */ > + push {fp, lr} > +.cfi_def_cfa fp, 4 > +.cfi_offset fp, -8 > +.cfi_offset lr, -4 > + add fp, sp, #4 > + > + /* Save caller's s16 value on the stack. */ > +.cfi_offset 80, -12 > + vpush {s16} > + > + /* Put our own s16 value. */ > + ldr r0, =value_callee > + vldr s16, [r0] > +break_here_asm: > + > + /* Restore caller's s16 value. */ > + vpop {s16} > + > + /* Standard epilogue. */ > + pop {fp, pc} > +.cfi_endproc > + > + > +.global caller > +caller: > +.cfi_startproc > + /* Standard prologue. */ > + push {fp, lr} > +.cfi_def_cfa fp, 4 > +.cfi_offset fp, -8 > +.cfi_offset lr, -4 > + add fp, sp, #4 > + > + /* Put our own s16 value. */ > + ldr r0, =value_caller > + vldr s16, [r0] > + > + /* Call callee. */ > + bl callee > + > + /* Store our s16 value in r0-r1 to return it. */ > + vpush {s16} > + pop {r0} > + mov r1, #0 > + > + /* Standard epilogue. */ > + pop {fp, pc} > +.cfi_endproc > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c > new file mode 100644 > index 000000000000..d18876fe3be3 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c > @@ -0,0 +1,33 @@ > +/* Copyright 2018-2023 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 . */ > + > +#include > + > +uint64_t caller (void); > + > +static void > +break_here_c (uint64_t value) > +{ > +} > + > +int > +main (void) > +{ > + uint64_t value = caller (); > + break_here_c (value); > + return 0; > +} > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp > new file mode 100644 > index 000000000000..c3d0979799dc > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp > @@ -0,0 +1,86 @@ > +# Copyright 2018-2023 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 test is in the same vein as amd64-pseudo-unwind, making sure we can > +# read write pseudo registers in outer frames. However, it tests a special > +# case where the debug info includes unwind information for a pseudo register > +# but not the underlying raw register. This can happen for the pseudo register > +# s16, which is the bottom half of the raw register d8. > +# > +# See "DWARF for the ARM architecture": > +# https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aadwarf32.pdf > + > +if { ![istarget arm*-*-* ] } { > + verbose "Skipping arm pseudo register unwind." > + return > +} > + > +standard_testfile arm-pseudo-unwind-legacy.c arm-pseudo-unwind-legacy-asm.S > + > +if { [prepare_for_testing "failed to prepare" ${testfile} \ > + "${srcfile} ${srcfile2}" {debug additional_flags=-marm}] } { > + return -1 > +} > + > +clean_restart ${binfile} > + > +if ![runto_main] then { > + fail "could not run to main" > +} > + > +gdb_breakpoint break_here_asm temporary > +gdb_continue_to_breakpoint "continue to callee" > + > +# Verify the value of s16 in the inner frame (callee). > +with_test_prefix "callee, before change" { > + gdb_test "p/x \$s16" " = 0x20212223" > +} > + > +# Verify that we can change the value of s16 in the inner frame (callee). > +gdb_test_no_output "set \$s16 = 1.0" > + > +# Verify the value of s16 in the inner frame (callee) after the change. > +with_test_prefix "callee, after change" { > + gdb_test "p/x \$s16" " = 0x3f800000" > +} > + > +# Go up one frame, and do the same. > +gdb_test "up" > + > +# Verify the value of s16 in the outer frame (caller). > +with_test_prefix "caller, before change" { > + gdb_test "p/x \$s16" " = 0x10111213" > +} > + > +# Verify that we can change the value of s16 in the outer frame (caller). > +gdb_test_no_output "set \$s16 = 2.0" > + > +# Verify the value of s16 in the outer frame (caller) after the change. > +with_test_prefix "caller, after change" { > + gdb_test "p/x \$s16" " = 0x40000000" > +} > + > +# Go back to frame 0 (callee), check that the change to the outer frame didn't > +# mess up anything there. > +gdb_test "down" > +with_test_prefix "callee, after change in caller" { > + gdb_test "p/x \$s16" " = 0x3f800000" > +} > + > +# Verify that the value of the saved s16 we changed is correctly seen by the > +# inferior. > +gdb_breakpoint break_here_c temporary > +gdb_continue_to_breakpoint "continue to break_here_c" > +gdb_test "p/x value" " = 0x40000000" > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c > new file mode 100644 > index 000000000000..d18876fe3be3 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c > @@ -0,0 +1,33 @@ > +/* Copyright 2018-2023 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 . */ > + > +#include > + > +uint64_t caller (void); > + > +static void > +break_here_c (uint64_t value) > +{ > +} > + > +int > +main (void) > +{ > + uint64_t value = caller (); > + break_here_c (value); > + return 0; > +} > diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp > new file mode 100644 > index 000000000000..bfe81b7d5f21 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp > @@ -0,0 +1,88 @@ > +# Copyright 2018-2023 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 test is equivalent to amd64-pseudo-unwind, but specific to ARM. We > +# use the raw register d8 which is 64 bits long. We use pseudo register s16, > +# which is the low 32 bits of d8. > + > +if { ![istarget arm*-*-* ] } { > + verbose "Skipping arm pseudo register unwind." > + return > +} > + > +standard_testfile arm-pseudo-unwind.c arm-pseudo-unwind-asm.S > + > +if { [prepare_for_testing "failed to prepare" ${testfile} \ > + "${srcfile} ${srcfile2}" {debug additional_flags=-marm}] } { > + return -1 > +} > + > +clean_restart ${binfile} > + > +if ![runto_main] then { > + fail "could not run to main" > +} > + > +gdb_breakpoint break_here_asm temporary > +gdb_continue_to_breakpoint "continue to callee" > + > +# Verify the value of d8/s16 in the inner frame (callee). > +with_test_prefix "callee, before change" { > + gdb_test "p/x \$d8" " = 0x2021222324252627" > + gdb_test "p/x \$s16" " = 0x24252627" > +} > + > +# Verify that we can change the value of the pseudo register (s16) in the inner > +# frame (callee). > +gdb_test_no_output "set \$s16 = 1.0" > + > +# Verify the value of d8/s16 in the inner frame (callee) after the change. > +with_test_prefix "callee, after change" { > + gdb_test "p/x \$d8" " = 0x202122233f800000" > + gdb_test "p/x \$s16" " = 0x3f800000" > +} > + > +# Go up one frame (to caller), and do the same. > +gdb_test "up" > + > +# Verify the value of d8/s16 in the outer frame (caller). > +with_test_prefix "caller, before change" { > + gdb_test "p/x \$d8" " = 0x1011121314151617" > + gdb_test "p/x \$s16" " = 0x14151617" > +} > + > +# Verify that we can change the value of the pseudo register (s16) in the outer > +# frame (caller). > +gdb_test_no_output "set \$s16 = 2.0" > + > +# Verify the value of d8/s16 in the outer frame (caller) after the change. > +with_test_prefix "caller, after change" { > + gdb_test "p/x \$d8" " = 0x1011121340000000" > + gdb_test "p/x \$s16" " = 0x40000000" > +} > + > +# Go back to frame 0 (callee), check that the change to the outer frame didn't > +# mess up anything there. > +gdb_test "down" > +with_test_prefix "callee, after change in caller" { > + gdb_test "p/x \$d8" " = 0x202122233f800000" > + gdb_test "p/x \$s16" " = 0x3f800000" > +} > + > +# Verify that the value of the saved d8 we changed is correctly seen by the > +# inferior. > +gdb_breakpoint break_here_c temporary > +gdb_continue_to_breakpoint "continue to break_here_c" > +gdb_test "p/x value" " = 0x1011121340000000" LGTM for the arm/aarch64 parts. Reviewed-by: Luis Machado