From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2078.outbound.protection.outlook.com [40.107.14.78]) by sourceware.org (Postfix) with ESMTPS id 21D973858D35 for ; Thu, 14 Dec 2023 14:54:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21D973858D35 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 21D973858D35 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.14.78 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702565685; cv=pass; b=H7VywDuHhOnNWnQCTpS8AYHc8NsCr/RV4JqFJit7j/G3K7wNz5l/oo82SkbKHjBft7sulpZsj7Vw8bBC2SbLoUylAoKDvWsSmlMrb8vTYyuvBhc0dQyqTYMSCv6w3ovy1FZSUXgpvD7RNEvfaa28Qe1CvYFwhK8wOEXzf17vMaQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702565685; c=relaxed/simple; bh=P7byFjN9LqYQabvhCjAZED5ivGsk/PxIM4eeSIdZ7j0=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=QYQaMkcepM24JQ2OeJ1Ky45R+2QS2WnDRB4oyUClwKtUNJElzlJ2tutsDID9yvZ2LXW7ruJ6HE0LnLY75QPmjcfdHFC+7KKCcSOOHfdkQkjSGJ8G6RxQpoDMVdBobIt5tV/y+15GQOdX+B2PU3Er5cpvyciFcvCUN9PKlSVpNHQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ESKUqAQDWYPnHt3EuKVuI2LSJ7jX5GUNyTmgF58dpaV82k7bCNf3OVOASvqTLkCyM9x9xkbKwzN02DMaMzcngCyHF5hRRC/X7z2w9ihhppx3Y0lWMNuLfOsGIOe8gJvhuQBUbYUMB2wPyQqz6dZ201UaMqFoDiMjsYTQsxNQFczWikNqAr3kmKysKX0wfza7KEBoG4IJF+1Gz3cDXU49+CHsJdyI4bLjy1XyGfhATkCX5mvFGQEZrcc4qT0s/kDbrQxI4G4IrqUQ7gNXSB01EQezb0xPKt+0wMipHI+nlsFS6YsE1Fty4FpGLE+sEkVp8B1NhLZ/SgElvXeRI6jL4Q== 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=33yddsQo17XNpgvl7mnkHXYKaNHWbgR0Gv9H+ao4c8Y=; b=OAbhruF/8FWJpco1Y5gKzneSvXqf8WuWhLjs68V6LWDBurCXr89xceB6dNSUeaVL+tNmwUoj1vOXH5tlwzqe3fDyegUU1Vxhs4AplekClZrNWVHFabHflkwYukonPAsoCFJFZyRUwrwnWWg/9IrL6oSp5En8adFU40XKAk5EeNeFOZv0osTZx0WoKqaPmtcgp5KGJNp8iZ61Uw45x71XF7DJiUnnTkPotOCdfd89LH7YvZsXMDk9dFqJeVepsShr75vyLgdE9z8SXQR4djJ0rTqkyNqGbra4XBQ9B+e/BFWx5/NG8lgnEe2o9vl3NBva9w2mR/2njrD5gbaGY7xgZg== 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=33yddsQo17XNpgvl7mnkHXYKaNHWbgR0Gv9H+ao4c8Y=; b=lmz8J/Ucz5P3IBL5viRWQMchncc+Y497efASexWQSFT2ncwzG3/iUrJv7TVBR6qrfWQch1JfZkxv8G8LJvl3ja3rmoaZ1N5T+Oyi4PjWB1IcED4B7eCKnmhyEg95XMGWU2eps1FiC7Qdm6Gq719i+h48OWzeYBHeR8vkxEPBxOE= Received: from AS4P195CA0044.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:65a::7) by GV1PR08MB7705.eurprd08.prod.outlook.com (2603:10a6:150:50::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28; Thu, 14 Dec 2023 14:54:37 +0000 Received: from AM4PEPF00027A66.eurprd04.prod.outlook.com (2603:10a6:20b:65a:cafe::b8) by AS4P195CA0044.outlook.office365.com (2603:10a6:20b:65a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28 via Frontend Transport; Thu, 14 Dec 2023 14:54:37 +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 AM4PEPF00027A66.mail.protection.outlook.com (10.167.16.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26 via Frontend Transport; Thu, 14 Dec 2023 14:54:37 +0000 Received: ("Tessian outbound 385ad2f98d71:v228"); Thu, 14 Dec 2023 14:54:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 416f82015260b41e X-CR-MTA-TID: 64aa7808 Received: from 912594e92cb1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F8B0A39-5700-4CD4-B5EA-D38DFCCD3361.1; Thu, 14 Dec 2023 14:54:30 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 912594e92cb1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Dec 2023 14:54:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J5EbZqZNhi/FdWEGqQWn8bmOpKeZNKAQN8DJwArTmEDgX9RlxCuQmTAbKfSsIysHOSTcUefG4JuYIzJtbk3iv7t+1smgsi6yoQAWkm1/gCrw3r5Q8oNFTCIQMzd0rw7w7xZe4g5AUQh/CbKeKYwRpV0OKCFrlXUiF9AN9x6DfkdAYvlqD9gbmDwhsVEIH+d+n4dfXDYLEAPe1EWnA82bB3h5yt4zC1Zf3YexR2yKSbjGRO79PkVZpPiO6CWgwnK4Dx8/Gvi0NSWvHQOdKvqkO2+hq+/1aBfLJLB7QnEYWk7TCHfGzcJsSzrH9xVrA37f0ZoGUTDDOfSv+oAQgaEGXg== 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=33yddsQo17XNpgvl7mnkHXYKaNHWbgR0Gv9H+ao4c8Y=; b=SeeS7eke1bDgqJyJUxnRsMk9R5e7SWRGH9L7Pv+CamHRncTcA1OcVDTOd38cp9bZVDDD9oluJzOQq9Ol0PNn9RnVmoyOT28dP5e4ccLc2Js8JApmV5y0lTFgpTpbzoSFLMjdsrSO2rt2k2x0fj9zDe0dOiDi295mJxYQj5PXgplSSdTVgFIvsc5QZkIzqObcDxNSTxK13al6l9B/ii64NdaPDWpo2icjC2uS1vqLqMq4ILBXlJMrDFHPHKX0PnsXZ4YK1NSjWrZSB1zp7NPg6yabu2OybLpeVLnGq5xUdGYg9hKpg7NkD47Ez1GNpy9jy60GfGg2CwJGYEzYftoDJg== 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=33yddsQo17XNpgvl7mnkHXYKaNHWbgR0Gv9H+ao4c8Y=; b=lmz8J/Ucz5P3IBL5viRWQMchncc+Y497efASexWQSFT2ncwzG3/iUrJv7TVBR6qrfWQch1JfZkxv8G8LJvl3ja3rmoaZ1N5T+Oyi4PjWB1IcED4B7eCKnmhyEg95XMGWU2eps1FiC7Qdm6Gq719i+h48OWzeYBHeR8vkxEPBxOE= 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 AS1PR08MB7636.eurprd08.prod.outlook.com (2603:10a6:20b:478::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28; Thu, 14 Dec 2023 14:54:27 +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.7091.028; Thu, 14 Dec 2023 14:54:26 +0000 Message-ID: <57141eab-a888-419c-b1b4-36f19b5d6036@arm.com> Date: Thu, 14 Dec 2023 14:54:26 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 24/24] gdb/testsuite: add tests for unwinding of pseudo registers Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org Cc: John Baldwin , "Aktemur, Tankut Baris" , Simon Marchi References: <20231201162751.741751-1-simon.marchi@efficios.com> <20231201162751.741751-25-simon.marchi@efficios.com> From: Luis Machado In-Reply-To: <20231201162751.741751-25-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0139.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c4::14) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS1PR08MB7636:EE_|AM4PEPF00027A66:EE_|GV1PR08MB7705:EE_ X-MS-Office365-Filtering-Correlation-Id: d3cd203b-f832-41a4-4cda-08dbfcb497a1 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: 1/aLaNX0sbvS5v/CsHnyaz2wn9VC1aK1+FxbiRy0piOaq5dqWsNZ03PjwBZAgtSeYlM2m4yVgCjgBaHRA9JaHvi5vd6wRS6pZ1pYK6MRwgrC2gAMKZxOC366bifIi8ZdQeewjKY5SPKwSJoyOO34IL0OX18SAIwkgChNc/RZ7pA5bE4ce1dRsw/KBtl9Nk88lIa5f2qjYmuWEK7yEHWNcTDrLVt7Wxql79ANlf071YkvyJAEe7IITW+/JVWfxAUIWH8fBHe4wJGA0cnys7AktnKrWKDCD2gQhexSdNgil79QkvpyQ/vVHqjnmaz0V31Eg/SiU9FkIpVmDamLOhguV4ogOctcLaObVIpom1gZIHr8yFUUwtXLrj1OMdoKzPQnSyyfdnlHUYxRj+HQXfm7IWDNLSi85msmXgJO4E1GD7R/CHjwabuYAPZRt1GLQBU0uvlcMi4hFytuEfuwCMGS/jy0P84XUdKe68fz5ssV4+GJQcQS51uiDbBf/Nv9QD+9Mocd+EV0oCvzLimy3gnTWHRZIMqLUt1Rd+jDnQHvdOHC+aS3ieZGe8XfZJK9+bSObAqMStvLXgK+4ecRnwvU5J5gA4V+i8+OYs2TzXe2T30C8y8/mzp9RBYsFnNL5w8EG/kfn+GlCRS80gllSkfWHcUXD/p4lBiSlwthuAm8DTv0Xn9IqcgnyEP00nyaDuDmSIjoeuCdWoy2Mm2I7RVUSg== 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)(136003)(376002)(396003)(346002)(366004)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(31686004)(478600001)(6512007)(36756003)(6486002)(966005)(26005)(54906003)(66476007)(66556008)(66946007)(38100700002)(2616005)(83380400001)(53546011)(6506007)(31696002)(316002)(44832011)(8676002)(4326008)(8936002)(86362001)(2906002)(30864003)(41300700001)(5660300002)(2004002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7636 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: AM4PEPF00027A66.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3edbeb34-260c-4a3e-1e59-08dbfcb49162 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qw8n6vS8BUlwvwpGWUH078nSRbA9IuGDRCkRBoEqu+ULoKcS1+IP98rjBLGvNcPYSSn4IV4SEUrgF1pHiR23Kqj3JENa6poMXZIHkOqoAe5HDNa2JHtGY1fcdZpphSeDNUB2y32IKGm2PQvJ9gENad0Kc5Pggy2PHXxKhmJCOhMULfsZW6oKStQOj1lkxPahE2sn2Pr35wtEXYEJbUWLLN3BN7T1CUaKPe1YRovrxgoUL7VuYoGu/adwQkO5rK75y8rn2aG9fKC22qUk3Uw5R8GDIN0ko73LhqIBShcUxrerB/fIuqt5jobAbcH04xo9qCWeXSgf1Xg4SjwHbA/ru9A7LZXanE7GIdSx5mp7FAj/fGIm4+RUIrVdAQKLgQLsOA28wHaa9WsIZ3GT2IKB3CaEVfHvIV0zEkNWTUBzWQ+AY2Wh12VcpNNNARrSF2Zm5x6mhwSSjFTctsjjBQ6whz6E1s8uwerq0rsOQrEU+Vl0W8DeisZhD+m52BYvORneAabJ50TNZAwMSmmD30Jr7R+nT7Lz/PdS8Z+iQIdkSORNgLS0fvDs2n2GF3u/6sh0YdZdSWtAr7sgIEIRVtwFPAcyi3YEQDW6OB4AJ623bETYq9mRZuBr9ukC8pcLBAOUeW+Xf05koaylnJM8f0UBkkGL2s7f4Uw7EGGY8amfgE9KmCCqPnk1iduj/Uvba2dgj9B+LOwyzs8XtkGXSca1Xqp5MiAK5zwueQZK3Njsn4ukf43ThkhV4z2S/wy4ElQATN14B/xJg1qWacdmmy9tzLXOuZP217tjuL0tdHlIsvI2FUqFW97PM93l98gVJIkH 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)(136003)(376002)(346002)(396003)(39860400002)(230922051799003)(451199024)(64100799003)(1800799012)(82310400011)(186009)(36840700001)(46966006)(40470700004)(44832011)(336012)(8676002)(4326008)(8936002)(107886003)(26005)(356005)(41300700001)(31696002)(86362001)(81166007)(82740400003)(2906002)(47076005)(30864003)(36756003)(36860700001)(83380400001)(6506007)(5660300002)(53546011)(40480700001)(54906003)(6512007)(478600001)(316002)(70586007)(70206006)(31686004)(966005)(6486002)(40460700003)(2616005)(2004002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2023 14:54:37.0675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3cd203b-f832-41a4-4cda-08dbfcb497a1 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: AM4PEPF00027A66.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7705 X-Spam-Status: No, score=-11.7 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 12/1/23 16:27, 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 > Reviewed-by: Luis Machado > --- > .../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" Approved-By: Luis Machado (aarch64/arm) Tested-By: Luis Machado (aarch64/arm)