From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GP0ROHzYU2gtZhQAWB0awg (envelope-from ) for ; Thu, 19 Jun 2025 05:29:32 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=I+AfGPG1; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=I+AfGPG1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C55571E11C; Thu, 19 Jun 2025 05:29:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 51E5E1E102 for ; Thu, 19 Jun 2025 05:29:31 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A0393874535 for ; Thu, 19 Jun 2025 09:29:31 +0000 (GMT) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazlp170120005.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::5]) by sourceware.org (Postfix) with ESMTPS id DEF21386E148 for ; Thu, 19 Jun 2025 09:26:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEF21386E148 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 DEF21386E148 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::5 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750325166; cv=pass; b=SRTXSWdDcfbl9YO9tDYMqd3JsZMSCJjLYzft9KR0T6UrMWGm3yBLons6h+nXwLau1dlpaqYd8d9h5pMeKSmM3JOmePHFUXQwrP5BT8O5NbO1DzRIIYU1T1uWwlvS/HGNwBXeMvV+4Roeypu9QKx9bYloky/6XuwM3IJNHMEJsyQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750325166; c=relaxed/simple; bh=aXMTt0cXzogcMhEEfKYzOtUKc4sgzbaaMvF/JqwSO0s=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:From:Subject:To: MIME-Version; b=sHQ1UdQu5RDUv+0Lw1EyxfHqWPJeArYAAqr/c4iwm3Mw8ubnrl5P7zuYyoLygE4IlvblcLeXJWwrqgwXyzaG5sInSasEbLEeaLb1k8rr548xFFmf82uAA2unWwEC+6ipiteCT359XTI7zQdFArcoCAVGTkw9nSqRWleWGEbTkls= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEF21386E148 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=I+AfGPG1; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=I+AfGPG1 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=VmkkdoXIR/81hd6S7f3xpFvCEqo4sHE634SUnnxAHvbDPpWLYLsNjCPVjvK7JaoCrA5wx6/js3LF46pQ4GJxlsECFwu6dEcenTmsAcpYlIbYHN+wti9nhKP8s307Ksn7D71L/ydL1HeijXE8Kk1THDMYks03sAifqhnbFU9uabYGvhbsHNXnPqsssPutc/VZqi42HWUSKR+NRMh5WbnpFfY6l9B2RtkQxBp0jTaQi8G4D9K0mHNkAwvB1iH23nSveuh0P8yuEZG3Pxg/hhtXYm5HSGZshF+K9K72SSaONjVdXlrCQeNdUgYBa84eoMKq4WTnBPhmwin1fL/zITXO0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UMDTTvLvSWgdiLDojGzrvu0xqLHNtuZAdxtrUQ473qY=; b=rLsoDoyLkKvJZo6UO2AzDsZ69zRct7sMt+UKlpyGJ7Z/4ZPn7//VxdulWGR1ugbYwTpcFsKj/wNMIHFPZjXWJ5u2y0ZFIxJ3itMhat6UJ1X/Du084pOsm1Nmc4A45y1xe8Vb0SyYVrp4mF3KBRLA7WnLBn9rCGsamozn3Sk/7y5zt+9xpBl2vdH5G58jic5baRNfsdHfhEWK+Sm808e99My0t3akRQYfmIjFLmUEExXS2+w/nZ6OgNITCsiYY60v389YFNEzS/uVhg+feQy25/xElqA2Ta5q8IdC1o9pQwYdJTu2KV+kXbtNlWLPaOg7uIQckaWvQ+Q5J2ho31oFyg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=intel.com 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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UMDTTvLvSWgdiLDojGzrvu0xqLHNtuZAdxtrUQ473qY=; b=I+AfGPG1dd7GQNimnBy4VL1xMjAJcejvxSjUP4EabuEOYzMxR6MO2fgtAp4GzdUVZYB8SGtnNIY2vcHTFWuDq/6ewQu+3ymyeR1VxuIPnImynajFFot4w1b/0R1LL+n8+EkxD7OzcjZc6UNPbBsBM+dxNp1eUPI7daoL99HESqs= Received: from AS4P189CA0048.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::12) by DBBPR08MB5914.eurprd08.prod.outlook.com (2603:10a6:10:200::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.30; Thu, 19 Jun 2025 09:26:03 +0000 Received: from AM4PEPF00027A66.eurprd04.prod.outlook.com (2603:10a6:20b:659:cafe::55) by AS4P189CA0048.outlook.office365.com (2603:10a6:20b:659::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8835.35 via Frontend Transport; Thu, 19 Jun 2025 09:26:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM4PEPF00027A66.mail.protection.outlook.com (10.167.16.91) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8835.15 via Frontend Transport; Thu, 19 Jun 2025 09:26:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rZgTE8SzS+70I4QfSYFaK0pmZ+LPROBlChIywAJbrs7k8hj2KsvIqERtqoYiueSeXcnSuzcPQOfjWndEdwLu2AJXVYRwJej09Kjr2K3v/+g5BjEkyS7K9LoOh165Ntf75A/o8eAYu02A62oaEOCXPofT6dKxvKvtSKPfhhSJ3z0tP4747VaUqWAMvifXkX8ev3ZU5p6tlxQpyj0U3CmQwLCL2OtwJi+/nfvQ360jjNtKmuov0ddyZjKUaj5tlMBrEDh9Rp0cl9zxGhg+YpebHTzetzp1WuFxA7D8yfcveg/ODj1DUlZ+TZjVYdZVia88d5lnWgGYHS/ziKN6DbsUzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UMDTTvLvSWgdiLDojGzrvu0xqLHNtuZAdxtrUQ473qY=; b=rUpQDfrXdtG9eA8UkF/b8keQgqlDkmItlY4cWzLLqIvHlq15jTdfq6lukQbbIxuyxlxYYY4JWQhA+kD8CrQXQBgacculNye4xMq48tMAHxXOsUkZYQ8GLWd0oit9z1lbVmF1o1apXJb+C6zpZlrxFGT58OCsPon3V7vNJE3xqD6JFcmcnyLon0q4sA4PpAgZhYAgRl1eEac58Ktuxbj6svyDu5OKpT7si4pPGvaLRsT/v1GoDUNKJJk7u8nJ+ijWCs9Kwp5i0IMgzNdSYOBpGFz8I88z1xf8/EYNU9o8Buy4hMfYoIQFnS7F75e+2vk1XKO2NrwFgqTWhH80dKMG1A== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UMDTTvLvSWgdiLDojGzrvu0xqLHNtuZAdxtrUQ473qY=; b=I+AfGPG1dd7GQNimnBy4VL1xMjAJcejvxSjUP4EabuEOYzMxR6MO2fgtAp4GzdUVZYB8SGtnNIY2vcHTFWuDq/6ewQu+3ymyeR1VxuIPnImynajFFot4w1b/0R1LL+n8+EkxD7OzcjZc6UNPbBsBM+dxNp1eUPI7daoL99HESqs= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) by AS4PR08MB7829.eurprd08.prod.outlook.com (2603:10a6:20b:519::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.26; Thu, 19 Jun 2025 09:25:29 +0000 Received: from PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d]) by PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d%6]) with mapi id 15.20.8857.019; Thu, 19 Jun 2025 09:25:29 +0000 Message-ID: <2940f05f-dfdf-4f31-869a-9528d6612209@arm.com> Date: Thu, 19 Jun 2025 10:25:28 +0100 User-Agent: Mozilla Thunderbird From: Luis Machado Subject: Re: [PATCH v4 08/11] gdb, gdbarch: Enable inferior calls for shadow stack support. To: Christina Schimpe , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org, eliz@gnu.org References: <20250617121147.1956686-1-christina.schimpe@intel.com> <20250617121147.1956686-9-christina.schimpe@intel.com> Content-Language: en-US In-Reply-To: <20250617121147.1956686-9-christina.schimpe@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0454.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::34) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|AS4PR08MB7829:EE_|AM4PEPF00027A66:EE_|DBBPR08MB5914:EE_ X-MS-Office365-Filtering-Correlation-Id: a8f2a685-826f-42a8-a9a0-08ddaf134f12 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?RHUzeE9YcW1QaFFSYXpJS0tWZ2xyYjVHZkFLbG1MS05xZlNQc0VVTHFvdE5k?= =?utf-8?B?MWtuaEdVb00rWWFCbG5pek0vL01LK0l4aW45a2toSnBrVDRkL3BDSW55WXR1?= =?utf-8?B?NHdEdnBSMVRUZjA5NXhmbGpRSEU2ZmgvUllBNFpVUUVXa2JhZndhUTBjSExO?= =?utf-8?B?andzSi9wSGZHbjg1NW5zSkFmZWhhOHNrYisxdTExM1FmaHp1YWtXNHVrRWZ0?= =?utf-8?B?VmpOdGtBa1AwZ2pxUnFrQmVocXJXLzd3TFJVNlZVRDlaU1dudGd0VkdNSjM5?= =?utf-8?B?R3pMc0pGTmduV0hpZmVUWkNzMzROS0wxd1QwS0FnNWNpQWZxZDFxUnNkSmNJ?= =?utf-8?B?QUk0dE9aMDhVM1VKRkxKRWxIQ2diNExWSkdtZ29qWm1ITHNtZGhDSzZNVDhQ?= =?utf-8?B?cmJLN0dRY0RmV2RFWEMzOGNDL1JKR3VYMGErZzhUQnQ2WWNqVk54U3BhbUI0?= =?utf-8?B?eElNTnhxUTI4RTJhSVN0MTJxMnJSaktlbFpPTzBvZzBhWERXRGFlMXQzMFho?= =?utf-8?B?TVgxa3NUWHRIY25NcmhpbFRCamRFaWo4NVRXMmtxanJEd1E2TnJPQXUyeFRz?= =?utf-8?B?cTN0Ly9MdjhsL0MwN09zWEZyQzdlM3hXNTBEYUtMaHlhS3MxNjJ0SitYbllY?= =?utf-8?B?a2xPYjVt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ESGNJaXNZeFlFVFYyVm5KWGEwMUZMSnoveVhrZ2hEUzNVanR2?= =?utf-8?B?RXVnZk5DenNpNXVSNmVGSTdkT0JHVmVlejNBMWV4akVoWVBwZWxkaWl6dFVq?= =?utf-8?B?QjZTSmVvUklhM0hnOFlWSno4ZG5zS0RKWTRnL0hHWE1SdWo1dk82OXdNTEx4?= =?utf-8?B?dFZCQllQell4ZHlSMy8rdk4vZ1dtTTRESEJZRHZYenhzaGw5UlpIYWQ5WUc1?= =?utf-8?B?dFA0RHYvQ25mckU1MVV6ZU1rZ05wTVBVdzVWaStkQjBGL0FXdFhXNmpEK2J1?= =?utf-8?B?S0NVeEE2elVlRWNsSGZ3UWp5NkNFT3oxMlNjRlorcE9MQXdkUnRGM2pQOHdI?= =?utf-8?Q?z+5EniiMevE=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5852.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7829 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A66.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bcfcda5c-5843-4cbd-1aae-08ddaf133b69 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|82310400026|14060799003|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YjJIZjJxYkVWN24xY0lwdGxlNXFVZitmSTB0WndxMWdrcFROUUpDQjVZSlRC?= =?utf-8?B?MTJ3MTl2OVQ5V1dFMjIvYXpSaThjUVpoNnoyektVejVIcGlrOHJsT3krOWFa?= =?utf-8?B?Q1VrK09zZ25XcGpiemFkUDdJSUdMbGpwbHloT1NxRC94dThHVEdYdVMycDM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pVL1UyZlpJLzh5ZytXb01Kdk9K?= =?utf-8?B?U0VrL2Y5a2psMG1qNjJNR0lkTVZGeFNmUmJZZ1BsN1NSUHpjZ2txaVZXQThq?= =?utf-8?Q?xG2naf?= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:ErrorRetry; CAT:NONE; SFS:(13230040)(35042699022)(82310400026)(14060799003)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2025 09:26:02.1281 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8f2a685-826f-42a8-a9a0-08ddaf134f12 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.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: DBBPR08MB5914 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 6/17/25 13:11, Christina Schimpe wrote: > Inferior calls in GDB reset the current PC to the beginning of the function > that is called. As no call instruction is executed the new return address > needs to be pushed to the shadow stack and the shadow stack pointer needs > to be updated. > > This commit adds a new gdbarch method to push an address on the shadow > stack. The method is used to adapt the function 'call_function_by_hand_dummy' > for inferior call shadow stack support. > > Reviewed-by: Thiago Jung Bauermann > --- > gdb/gdbarch-gen.c | 32 ++++++++++++++++++++++++++++++++ > gdb/gdbarch-gen.h | 14 ++++++++++++++ > gdb/gdbarch_components.py | 16 ++++++++++++++++ > gdb/infcall.c | 14 ++++++++++---- > 4 files changed, 72 insertions(+), 4 deletions(-) > > diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c > index 32d16598940..3ca19c427a3 100644 > --- a/gdb/gdbarch-gen.c > +++ b/gdb/gdbarch-gen.c > @@ -262,6 +262,7 @@ struct gdbarch > gdbarch_read_core_file_mappings_ftype *read_core_file_mappings = default_read_core_file_mappings; > gdbarch_use_target_description_from_corefile_notes_ftype *use_target_description_from_corefile_notes = default_use_target_description_from_corefile_notes; > gdbarch_core_parse_exec_context_ftype *core_parse_exec_context = default_core_parse_exec_context; > + gdbarch_shadow_stack_push_ftype *shadow_stack_push = nullptr; > }; > > /* Create a new ``struct gdbarch'' based on information provided by > @@ -535,6 +536,7 @@ verify_gdbarch (struct gdbarch *gdbarch) > /* Skip verify of read_core_file_mappings, invalid_p == 0. */ > /* Skip verify of use_target_description_from_corefile_notes, invalid_p == 0. */ > /* Skip verify of core_parse_exec_context, invalid_p == 0. */ > + /* Skip verify of shadow_stack_push, has predicate. */ > if (!log.empty ()) > internal_error (_("verify_gdbarch: the following are invalid ...%s"), > log.c_str ()); > @@ -1406,6 +1408,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) > gdb_printf (file, > "gdbarch_dump: core_parse_exec_context = <%s>\n", > host_address_to_string (gdbarch->core_parse_exec_context)); > + gdb_printf (file, > + "gdbarch_dump: gdbarch_shadow_stack_push_p() = %d\n", > + gdbarch_shadow_stack_push_p (gdbarch)); > + gdb_printf (file, > + "gdbarch_dump: shadow_stack_push = <%s>\n", > + host_address_to_string (gdbarch->shadow_stack_push)); > if (gdbarch->dump_tdep != NULL) > gdbarch->dump_tdep (gdbarch, file); > } > @@ -5551,3 +5559,27 @@ set_gdbarch_core_parse_exec_context (struct gdbarch *gdbarch, > { > gdbarch->core_parse_exec_context = core_parse_exec_context; > } > + > +bool > +gdbarch_shadow_stack_push_p (struct gdbarch *gdbarch) > +{ > + gdb_assert (gdbarch != NULL); > + return gdbarch->shadow_stack_push != NULL; > +} > + > +void > +gdbarch_shadow_stack_push (struct gdbarch *gdbarch, CORE_ADDR new_addr, regcache *regcache) > +{ > + gdb_assert (gdbarch != NULL); > + gdb_assert (gdbarch->shadow_stack_push != NULL); > + if (gdbarch_debug >= 2) > + gdb_printf (gdb_stdlog, "gdbarch_shadow_stack_push called\n"); > + gdbarch->shadow_stack_push (gdbarch, new_addr, regcache); > +} > + > +void > +set_gdbarch_shadow_stack_push (struct gdbarch *gdbarch, > + gdbarch_shadow_stack_push_ftype shadow_stack_push) > +{ > + gdbarch->shadow_stack_push = shadow_stack_push; > +} > diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h > index 313a8f198fd..c276cd66d71 100644 > --- a/gdb/gdbarch-gen.h > +++ b/gdb/gdbarch-gen.h > @@ -1801,3 +1801,17 @@ extern void set_gdbarch_use_target_description_from_corefile_notes (struct gdbar > typedef core_file_exec_context (gdbarch_core_parse_exec_context_ftype) (struct gdbarch *gdbarch, bfd *cbfd); > extern core_file_exec_context gdbarch_core_parse_exec_context (struct gdbarch *gdbarch, bfd *cbfd); > extern void set_gdbarch_core_parse_exec_context (struct gdbarch *gdbarch, gdbarch_core_parse_exec_context_ftype *core_parse_exec_context); > + > +/* Some targets support special hardware-assisted control-flow protection > + technologies. For example, the Intel Control-Flow Enforcement Technology > + (Intel CET) on x86 provides a shadow stack and indirect branch tracking. > + To enable inferior calls the function shadow_stack_push has to be provided. > +> + Push the address NEW_ADDR on the shadow stack and update the shadow stack > + pointer. */ > + > +extern bool gdbarch_shadow_stack_push_p (struct gdbarch *gdbarch); > + > +typedef void (gdbarch_shadow_stack_push_ftype) (struct gdbarch *gdbarch, CORE_ADDR new_addr, regcache *regcache); > +extern void gdbarch_shadow_stack_push (struct gdbarch *gdbarch, CORE_ADDR new_addr, regcache *regcache); > +extern void set_gdbarch_shadow_stack_push (struct gdbarch *gdbarch, gdbarch_shadow_stack_push_ftype *shadow_stack_push); > diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py > index ec09d955088..ab685b14ec7 100644 > --- a/gdb/gdbarch_components.py > +++ b/gdb/gdbarch_components.py > @@ -2848,3 +2848,19 @@ which all assume current_inferior() is the one to read from. > predefault="default_core_parse_exec_context", > invalid=False, > ) > + > +Method( > + comment=""" > +Some targets support special hardware-assisted control-flow protection > +technologies. For example, the Intel Control-Flow Enforcement Technology > +(Intel CET) on x86 provides a shadow stack and indirect branch tracking. > +To enable inferior calls the function shadow_stack_push has to be provided. Maybe update the last part like so? "To enable shadow stack support for inferior calls the shadow_stack_push gdbarch hook has to be provided." > + > +Push the address NEW_ADDR on the shadow stack and update the shadow stack > +pointer. > +""", Maybe... "Push NEW_ADDR to the shadow stack..."? > + type="void", > + name="shadow_stack_push", > + params=[("CORE_ADDR", "new_addr"), ("regcache *", "regcache")], > + predicate=True, > +) > diff --git a/gdb/infcall.c b/gdb/infcall.c > index 098072dfd2a..a1c80c81238 100644 > --- a/gdb/infcall.c > +++ b/gdb/infcall.c > @@ -1448,10 +1448,16 @@ call_function_by_hand_dummy (struct value *function, > /* Create the dummy stack frame. Pass in the call dummy address as, > presumably, the ABI code knows where, in the call dummy, the > return address should be pointed. */ > - sp = gdbarch_push_dummy_call (gdbarch, function, > - get_thread_regcache (inferior_thread ()), > - bp_addr, args.size (), args.data (), > - sp, return_method, struct_addr); > + regcache *regcache = get_thread_regcache (inferior_thread ()); > + sp = gdbarch_push_dummy_call (gdbarch, function, regcache, bp_addr, > + args.size (), args.data (), sp, > + return_method, struct_addr); > + > + /* Push the return address of the inferior (bp_addr) on the shadow stack s/on the shadow stack/to the shadow stack > + and update the shadow stack pointer. As we don't execute a call > + instruction to start the inferior we need to handle this manually. */ s/start the inferior/call the function > + if (gdbarch_shadow_stack_push_p (gdbarch)) > + gdbarch_shadow_stack_push (gdbarch, bp_addr, regcache); > > /* Set up a frame ID for the dummy frame so we can pass it to > set_momentary_breakpoint. We need to give the breakpoint a frame Otherwise looks OK to me. Reviewed-By: Luis Machado