From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QZKmMaHVgmqM1ysAWB0awg (envelope-from ) for ; Mon, 17 Aug 2026 05:34:25 -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=o4+oZ8fY; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=o4+oZ8fY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C53741E0A3; Mon, 17 Aug 2026 05:34:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 8D5441E033 for ; Mon, 17 Aug 2026 05:34:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 704294BA23DD for ; Mon, 17 Aug 2026 09:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 704294BA23DD 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=o4+oZ8fY; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=o4+oZ8fY Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11012048.outbound.protection.outlook.com [52.101.66.48]) by sourceware.org (Postfix) with ESMTPS id 059DC4BA5433 for ; Mon, 17 Aug 2026 09:33:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 059DC4BA5433 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 059DC4BA5433 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.66.48 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1786959231; cv=pass; b=aE6GhALgnKIKPirnJGpBC0bpFbxb4MqfSRwQjwvdRO/VBb5nZiphze+SZfloELZuEKgCOGlSURAUNgTuiLsHleXOLittjm3x/rSNhyeAkwok+AmyCgovb49RjHHbYqteIZ0D131pqiz8p/qjFOpCE3ireBABz7GQI3ROhG9vYcQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1786959231; c=relaxed/simple; bh=21W0vIZZmiRhORzR9R2o/6w0N6+KNxfyzrQIY59dCXs=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:From:To: MIME-Version; b=WCg8D3wVTkGP/4beX/c5vWWdodhqD1YhjSq1ddM5NGGMBs/PUU5Qasn73ZRiGzwLRuo5lR2QPJ++ugAHLTUh3veOajDVSxiz+Zp2OUdd8OU8xs6LU2eourD7LWkRzO3sBgVBisMi5+RZTSsFfVozw/lFXS5eaq3IOgErqpRAdRw= ARC-Authentication-Results: i=3; 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=o4+oZ8fY; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=o4+oZ8fY DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 059DC4BA5433 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=a0sVjfEOrReE0ulyE2XZh552ROQXqNZvKqn47ALgnsXeb/s8to0hxE9XCRaYYfbF8bbWBMzzcTzb1H7oau284EgUZB205fvPOOGQ02xMowzivvof086P5nCgKlHVvWe80bR8ofMn0mjje0B/qJLf4Up2XFzDNGjSftizXgu/UB2pKZA5y8y3Fk0wTUEy5uFNOfpNDNmIrhIBf/7ulsqR/eAVIxFL6baiy+nGbpwbHlF0QiAxpdR1TmX03C8nr7/q5t7y+FYSqton5XSwt3QFVH0ZWLQLb+6qtgtmiAx72xfldYn1YcNsqvNIt2e552KIUYDdSPcm1O2j/y1AfVESGw== 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=fSJDzCsujgsmuLkTyNEuDxwBGSH4bkJPlB076q9o0VA=; b=QngrQVOiOfKvB6Qj9QCotpAdSG+wh/74SpOuL9iHlArW88+V5frNJfATr/qjI9dT6zdo4fhrv201T8xRx6ksOW1yA0AIZIhmAdrUuEm1KihOwal0eDSPy22z6PQBVVA9zm80gT3EGGBjGybKcUapyT6QOWsNlH8bf0Sxq0C/jT8j5a53kz8RbDi/zMNxPmI+TpMde2YKj6P13BdTgwIzNzALoUWPaCSpkT3kyHk8RkMKiI1AVjyeLNVyQb6XEP9ItQGtfnUpuOH/P0BV01/6yiy5X2SzpSAhqy9NAxK8mH3KskrZIrpXTAgBij0Gs8SSvc5TvLAI/qqJMcnlo3Bl+Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=simark.ca 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=fSJDzCsujgsmuLkTyNEuDxwBGSH4bkJPlB076q9o0VA=; b=o4+oZ8fYK6TVHwYAZkg9y85rtnKp3RmPa1JrdGbD1qX0zHlvpK4UMsrU13wNh6ei0kcGkMnGJWQ557xk8hgOl75OqUd4Ie+vzXhZd5kz5vaGnvP+dq4gVgJz7C/CmNuFOGpzFuncxx8NGvzj02aFBCEFGkcFRMbZJ27XRlgLn7s= Received: from DU2PR04CA0033.eurprd04.prod.outlook.com (2603:10a6:10:234::8) by PAWPR08MB10059.eurprd08.prod.outlook.com (2603:10a6:102:35d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.17; Mon, 17 Aug 2026 09:33:38 +0000 Received: from DU2PEPF00028D0A.eurprd03.prod.outlook.com (2603:10a6:10:234:cafe::6) by DU2PR04CA0033.outlook.office365.com (2603:10a6:10:234::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.315.17 via Frontend Transport; Mon, 17 Aug 2026 09:33:38 +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 DU2PEPF00028D0A.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.315.6 via Frontend Transport; Mon, 17 Aug 2026 09:33:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vXLBFnNBsfIB7ZhfFhgDf5XQK3Qcp0aoE6iOXbZEfim7x5pEVRQibVQhza6IWY/GL0Rw9184STKbpfOODYq4EnITEEwrBtCED6k/PN8FQdZGBpXdeeR4fCzvpCi+eM8iz1r6xpyRcc/9ivyznsXt4s4R9RfRNgrLu0FVp98bd23I6X+OFKqzfwLlSmXop8GaAdjlRlVWyzHxNWYwVJoCPhlRI75uNFtrk5RbmHnH2jvguQW98h4x/q4rYc/ElrU0vopLdd05TPb4txbmy6yyTU5f4B8Csy9WXpWDzF08zEIbFaNNRcsr2ppxlXEe96EhPB75qT8FrCmgtoCbmXIidg== 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=fSJDzCsujgsmuLkTyNEuDxwBGSH4bkJPlB076q9o0VA=; b=TKH00+R/gPgHEKDOJylWnrj4bZgeRiiU5dSyOSTSyLoHUGYVNvZv1LLf3N8mLYPKy/8TMXXAlim6x2CqAKvgp6cxRAHOKPCz9wAb+GydKl29kzW7H9t8KOqDK45WtHQca9yIMzoTXGup2lCxWH9DT1juNCeq2OhF/Nh8StY0LCmZD32LPPlIvWB6L8pEhDwGAnG2mmNgPiceRvCIkgNFLd8T1PKK8Olx5DInWLcQzI/jAbXM8zuYTnlucYSvHFUN84NZMi8GjYhdHHZYoErRqmhBQ4QPUFElGKYkf19Pu9S2kE5UJa2dzNUf7CpZpf78u3Lho0lPOb11v0a60XhLOw== 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=fSJDzCsujgsmuLkTyNEuDxwBGSH4bkJPlB076q9o0VA=; b=o4+oZ8fYK6TVHwYAZkg9y85rtnKp3RmPa1JrdGbD1qX0zHlvpK4UMsrU13wNh6ei0kcGkMnGJWQ557xk8hgOl75OqUd4Ie+vzXhZd5kz5vaGnvP+dq4gVgJz7C/CmNuFOGpzFuncxx8NGvzj02aFBCEFGkcFRMbZJ27XRlgLn7s= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0SPRMB0014.eurprd08.prod.outlook.com (2603:10a6:10:350::5) by AS8PR08MB9792.eurprd08.prod.outlook.com (2603:10a6:20b:613::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.17; Mon, 17 Aug 2026 09:33:04 +0000 Received: from DU0SPRMB0014.eurprd08.prod.outlook.com ([fe80::f381:cacf:9ed8:19c1]) by DU0SPRMB0014.eurprd08.prod.outlook.com ([fe80::f381:cacf:9ed8:19c1%5]) with mapi id 15.21.0315.016; Mon, 17 Aug 2026 09:33:03 +0000 Message-ID: Date: Mon, 17 Aug 2026 10:33:02 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] gdb: align siginfo_t with the Linux kernel definition From: Matthieu Longo To: Simon Marchi , gdb-patches@sourceware.org Cc: Luis Machado , Luis Machado , Thiago Jung Bauermann , Srinath Parvathaneni , "Maciej W . Rozycki" , Andreas Schwab References: <20260728123239.211813-1-matthieu.longo@arm.com> <50ac0d4d-7039-4ec0-837c-2b2bee7add3c@simark.ca> <10ce3491-6802-480d-b2c7-fc3bf0efb60c@arm.com> Content-Language: en-US In-Reply-To: <10ce3491-6802-480d-b2c7-fc3bf0efb60c@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0290.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::7) To DU0SPRMB0014.eurprd08.prod.outlook.com (2603:10a6:10:350::5) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DU0SPRMB0014:EE_|AS8PR08MB9792:EE_|DU2PEPF00028D0A:EE_|PAWPR08MB10059:EE_ X-MS-Office365-Filtering-Correlation-Id: 34f3272e-bb14-4564-6175-08defc429e38 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|1800799024|366016|23010399003|18002099003|22082099003|56012099006|6133799003|11063799006|4143699003|10067099003; X-Microsoft-Antispam-Message-Info-Original: pRlLd8/Ep9k1S/Dz8OI/FFbuX0VDeQlHedWca7vdFd1dQCeupwlcgykK+GVIC8r+9j+1bv9rr0f0sQu/FCLGtAZxqyeTgK1TueUyLp60rZpDd0MEA00oy6NfDeSQp0CPH0XNGFN0rf8rQs/cVfbOKCDv+7rE3mchCv0EAfVRb1KDIMyKUa88V89HGDn1RV0Q8PNKfZ1JqbZa5V0aHTsQjmLmzQlUrPRCQBa22oI+DyZXmytG07KsUeWlLeQUM8bSKJSGiNP9NGR272SeIKLgfqWC9ifu308duskiNpRIbz4w17/cDl7Q8T31+n+1UaUrSdzLgGVHFQg3c+hs2jffiAM9fi9+QXC7WMKXAx0XqwrYuAmWjmet6NgKD9mrqtUehhM40XO2vvrF+YsE2oUHGUqt6WKmvXSPd5OoxZVpf0KU7C+43OB6ejcDxO96EQxMQ3JjoqJgIS2KYM4gRcfEOUCM9wZc4+EIbNm/ptxZsTYfjqBagBjN86ITmZ5yASOYumUamD4Hxh15soNYT0sXqUJhxOMhSJ3Wf5cTM0jmGREFdELPVPHWMm2cu7SnI9M5uQkzOB+HGgvo5SjOMl4pCbEdo46G4n9btBR/6udCKInnE2vSpTQmeiph4JE13V2O2exaAhOuaYvjE6lm4pXGbmxfAr+qTIgx4EOrhnVZYUw= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0SPRMB0014.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(23010399003)(18002099003)(22082099003)(56012099006)(6133799003)(11063799006)(4143699003)(10067099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: nxmraXhfCQQQWur1YoAsuF0OZfKQqra0Cj/dFWou2WZxCzSZoq/qpSZYac0iOA4ay5+RxwAMgYlqU7aseglC7qe7oJKh1yJ8tpFn/0sjBXN9gu066WM6RfKPjaOKM9Lf+om93rZBCS9r8oq4teNTgEhzx5mD42ARU5V+nXT9L2IT9LvXKb8SKeRW41ZhtJpSSPXIHB/OUufumVRMVzikZgsc4FHQQulAk9hyVkviYVhKu2X/40Q0XfBU4EWdZvYavGY54FnYn82m3YQMqjDJGjTXsE3TJG2ZUZSGCogeKP6nyRmM7ZF33XMygy0x9il4Ogce/2mtVBKzue33lH8wfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9792 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D0A.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2d39f46a-aab3-43db-30bb-08defc428965 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|36860700016|35042699022|376014|23010399003|82310400026|1800799024|6133799003|10067099003|4143699003|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 21RL+00GFNOJG7Ao46UBcwX5ZH9Rr0fFVrhD0LaefgROH06YnIJFHr/WEzGESoYiWsmo05DR/I4j/IyrZTBcrHKMIn6v56tNzRJ7ODkVa5I+qjHWPOfT3YGNusNYnSloAmGgxMsCSCYGHBB2I8DZkqlktukQbfKfmRJnmxol6SPctjkKv4+TdRL2z02MJy2iBH2WjxuFSW9A+9Niv8wXIN0srHRCNjBRYub83yKdCTNsckESDvsii90bzAtz26J3Yo+g5dXsyufPD29+W1jpo70bCfPOp3eyuD3nvSyRvBZT7q/YtrpmCC1+pdfyzjz0FkFSBOB8p6r69xb+252pQMQxFQiViBaqf/ZVzTXyqIpO/AqJj7EYrmjzJmeuAr6DjeVccMSpIKDxJN4vCC2OJ8Jo42fKK1Ag9OZf57/FiBE4s4AnUo+CNyo7AzqVK0n4OMPie5EQACrallhc6ly1f+ufH6gjZNy5tbkOfFYHiEvstKPUUX0OV5eapGDGQO93pVhxmjvKcVRT5mlCa7cSN6Bi9JdbMFs3CbePIvyV6GVK9n9+9X6E/GJHO4F4jrCTX3BOiVBQnNZtxeddYP16RfylJVerq58iJ6zHIg+HNVSCaKtkd15BmklDwNNQdC3LtiRLhBu5NwTUF+zgtO5Kj3NfwtagWM30CqiAuZXR7DALKefDJup13BJUvFKRCLFN9mcqnzqxy0LczB1l+A7odw== 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:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(14060799003)(36860700016)(35042699022)(376014)(23010399003)(82310400026)(1800799024)(6133799003)(10067099003)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u1VmXoHwMa51EN8kkO1ked/fTSd8gUAzpSLxruo8aYUKmgIKnasYwXA/uh/pFMGtJd37as1Xb3dvZbhBtZ5q4RRphtvD3KHrYBIyE4rKT0l9Laq9hB8/srQvPDkZxWgnncNdKxi2/WLwsErBFpJmeM5hR8sraQtg9PgfucUYGtxyE4lIyfj4uOTG0raDRRqFdIDAAfYaXKmLdvM6vML2lN4VKR9tDXQL2t9QYSm9ybpFrk041EiQqF3MQoLg2ekStuFrfxniSbMsWcEbO9yY12ESDb8buSH6dgU+7OB0vqLCPJ9uSGa2kSNjscTfY4DEBJ25omS+CyIziKAYFS7iwJS6SAs+PfndBS4I1SFoqcgVQUATo+JW7VJVMxKv7k/99Ht2GkHI3/30RXH6s+nEWdKoBI6dwpzNG2q1hsNMT2BPqruOqHpjJ6JJMsPB1yIW X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2026 09:33:38.4594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34f3272e-bb14-4564-6175-08defc429e38 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: DU2PEPF00028D0A.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10059 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 13/08/2026 15:48, Matthieu Longo wrote: > On 12/08/2026 20:08, Simon Marchi wrote: >> On 7/28/26 8:32 AM, Matthieu Longo wrote: >>> GDB's current definition of siginfo_t is missing many fields present in >>> the Linux kernel definition [1]. >>> >>> These fields are useful for providing detailed, user-friendly diagnostics >>> when a fault occurs. Some new AArch64 extensions, such as Permission >>> Overlay Enhancement used to implement Protection Keys [2], require the >>> debugger to inspect 'si_pkey' alongside 'si_addr' to help the user identify >>> the problematic key. >>> >>> This patch aligns GDB's definition of the __sifields._sigfault member of >>> siginfo_t with the definition from the Linux kernel master branch. >>> >>> To avoid hardcoding the field access paths throughout the codebase, this >>> patch also introduces compile-time accessors for the siginfo_t attributes, >>> centralizing their definitions in a single location and making future >>> updates easier. >>> >>> Finally, extend the testsuite to verify access to the new si_pkey field >>> and its preservation when modifying $_siginfo and when reading core files. >>> The tests in siginfo-obj.exp rely on the siginfo_t definition provided by >>> glibc's , which does not yet expose all of the fields present in >>> the kernel definition. As a result, the tests cannot exercise every newly >>> added field and therefore focus on si_pkey, the field motivating this change. >>> The test validates that GDB can read and modify the field correctly; it does >>> not attempt to generate a real protection-key fault. >>> >>> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ >>> tree/include/uapi/asm-generic/siginfo.h#n69 >>> [2]: https://lore.kernel.org/all/20160212210213.ABC488FA@viggo.jf.intel.com/ >>> >>> Reviewed-by: Thiago Jung Bauermann >>> --- >>> gdb/aarch64-linux-tdep.c | 8 ++-- >>> gdb/linux-tdep.c | 52 +++++++++++++++++++--- >>> gdb/linux-tdep.h | 60 ++++++++++++++++++++++++++ >>> gdb/sparc64-linux-tdep.c | 6 ++- >>> gdb/testsuite/gdb.base/siginfo-obj.c | 1 + >>> gdb/testsuite/gdb.base/siginfo-obj.exp | 14 ++++++ >>> 6 files changed, 131 insertions(+), 10 deletions(-) >>> >>> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c >>> index f11eccc1bc1..235b35bcfb4 100644 >>> --- a/gdb/aarch64-linux-tdep.c >>> +++ b/gdb/aarch64-linux-tdep.c >>> @@ -2683,13 +2683,15 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, >>> >>> try >>> { >>> + using gdb_si = gdb::siginfo_type; >>> + using si_key = gdb::siginfo_type::key; >>> /* Sigcode tells us if the segfault is actually a memory tag >>> violation. */ >>> - si_code = parse_and_eval_long ("$_siginfo.si_code"); >>> - si_errno = parse_and_eval_long ("$_siginfo.si_errno"); >>> + si_code = parse_and_eval_long (gdb_si::get (si_key::siginfo_code)); >>> + si_errno = parse_and_eval_long (gdb_si::get (si_key::siginfo_errno)); >>> >>> fault_addr >>> - = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); >>> + = parse_and_eval_long (gdb_si::get (si_key::siginfo_addr)); >>> } >>> catch (const gdb_exception_error &exception) >>> { >>> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c >>> index 25d625db595..740043a9292 100644 >>> --- a/gdb/linux-tdep.c >>> +++ b/gdb/linux-tdep.c >>> @@ -272,10 +272,9 @@ static struct type * >>> linux_get_siginfo_type (struct gdbarch *gdbarch) >>> { >>> struct linux_gdbarch_data *linux_gdbarch_data; >>> - struct type *void_ptr_type; >>> struct type *uid_type, *pid_type; >>> struct type *sigval_type, *clock_type; >>> - struct type *siginfo_type, *sifields_type; >>> + struct type *siginfo_type, *sifields_type, *sigfault_union_type; >>> struct type *type; >>> >>> linux_gdbarch_data = get_linux_gdbarch_data (gdbarch); >>> @@ -285,11 +284,22 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >>> type_allocator alloc (gdbarch); >>> >>> const struct builtin_type *builtin_types = builtin_type (gdbarch); >>> + struct type *short_type = builtin_types->builtin_short; >>> struct type *int_type = builtin_types->builtin_int; >>> struct type *uint_type = builtin_types->builtin_unsigned_int; >>> struct type *long_type = builtin_types->builtin_long; >>> - >>> - void_ptr_type = lookup_pointer_type (builtin_type (gdbarch)->builtin_void); >>> + struct type *unsigned_long_type = builtin_types->builtin_unsigned_long; >>> + struct type *uint32_type = builtin_types->builtin_uint32; >>> + struct type *void_ptr_type >>> + = lookup_pointer_type (builtin_type (gdbarch)->builtin_void); >>> + >>> + /* Compute padding length, i.e. __ADDR_BND_PKEY_PAD. */ >>> + unsigned alignof_void_ptr = type_align (void_ptr_type); >>> + unsigned padding_size = (alignof_void_ptr < short_type->length () >>> + ? short_type->length () >>> + : alignof_void_ptr); >>> + struct type *addr_bnd_pkey_padding_type >>> + = init_vector_type (builtin_types->builtin_uint8, padding_size); >>> >>> /* sival_t */ >>> sigval_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION); >>> @@ -364,9 +374,41 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >>> append_composite_type_field (type, "si_stime", clock_type); >>> append_composite_type_field (sifields_type, "_sigchld", type); >>> >>> - /* _sigfault */ >>> + /* Begin _sigfault's anonymous union. */ >>> + sigfault_union_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION); >>> + /* used on alpha and sparc */ >>> + append_composite_type_field (sigfault_union_type, "si_trapno", int_type); >>> + /* used when si_code is BUS_MCEERR_AR or BUS_MCEERR_AO. */ >>> + append_composite_type_field (sigfault_union_type, "si_addr_lsb", short_type); >>> + >>> + /* used when si_code=SEGV_BNDERR */ >>> + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >>> + append_composite_type_field (type, "_dummy_bnd", addr_bnd_pkey_padding_type); >>> + append_composite_type_field (type, "si_lower", void_ptr_type); >>> + append_composite_type_field (type, "si_upper", void_ptr_type); >>> + append_composite_type_field (sigfault_union_type, "_addr_bnd", type); >>> + >>> + /* used when si_code=SEGV_PKUERR */ >>> + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >>> + append_composite_type_field (type, "_dummy_pkey", addr_bnd_pkey_padding_type); >>> + append_composite_type_field (type, "si_pkey", uint32_type); >>> + append_composite_type_field (sigfault_union_type, "_addr_pkey", type); >>> + >>> + /* used when si_code=TRAP_PERF */ >>> + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >>> + append_composite_type_field (type, "si_perf_data", unsigned_long_type); >>> + append_composite_type_field (type, "si_perf_type", uint32_type); >>> + append_composite_type_field (type, "si_perf_flags", uint32_type); >>> + append_composite_type_field (sigfault_union_type, "_perf", type); >>> + >>> + /* End _sigfault's anonymous union. */ >>> + >>> + /* _sigfault is set by SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ >>> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >>> append_composite_type_field (type, "si_addr", void_ptr_type); >>> + /* Since there is no possibility to declare an anonymous union, >>> + using '_anon_union' instead. */ >>> + append_composite_type_field (type, "_anon_union", sigfault_union_type); > > I set the name to "", and it works as you mentioned below. > I also fixed the usages in gdb/testsuite/gdb.base/siginfo-obj.exp > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 4660772752d..bbc4009d43c 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -406,9 +406,8 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) > /* _sigfault is set by SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ > type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > append_composite_type_field (type, "si_addr", void_ptr_type); > - /* Since there is no possibility to declare an anonymous union, > - using '_anon_union' instead. */ > - append_composite_type_field (type, "_anon_union", sigfault_union_type); > + /* Note: this is an anonymous union. */ > + append_composite_type_field (type, "", sigfault_union_type); > append_composite_type_field (sifields_type, "_sigfault", type); > > /* _sigpoll */ > diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h > index 43ed38c6633..1f40756eb2f 100644 > --- a/gdb/linux-tdep.h > +++ b/gdb/linux-tdep.h > @@ -143,14 +143,14 @@ struct siginfo_type > > /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ > "$_siginfo._sifields._sigfault.si_addr", > - "$_siginfo._sifields._sigfault._anon_union.si_trapno", > - "$_siginfo._sifields._sigfault._anon_union.si_addr_lsb", > - "$_siginfo._sifields._sigfault._anon_union._addr_bnd.si_lower", > - "$_siginfo._sifields._sigfault._anon_union._addr_bnd.si_upper", > - "$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey", > - "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_data", > - "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_type", > - "$_siginfo._sifields._sigfault._anon_union._perf.si_perf_flags", > + "$_siginfo._sifields._sigfault.si_trapno", > + "$_siginfo._sifields._sigfault.si_addr_lsb", > + "$_siginfo._sifields._sigfault._addr_bnd.si_lower", > + "$_siginfo._sifields._sigfault._addr_bnd.si_upper", > + "$_siginfo._sifields._sigfault._addr_pkey.si_pkey", > + "$_siginfo._sifields._sigfault._perf.si_perf_data", > + "$_siginfo._sifields._sigfault._perf.si_perf_type", > + "$_siginfo._sifields._sigfault._perf.si_perf_flags", > }; > return paths[static_cast (attr_)]; > } > diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp > index 5e36b334068..a724a634dc0 100644 > --- a/gdb/testsuite/gdb.base/siginfo-obj.exp > +++ b/gdb/testsuite/gdb.base/siginfo-obj.exp > @@ -115,7 +115,7 @@ gdb_test "p \$_siginfo._sifields._sigfault.si_addr = 0x666" " = \\(void \\*\\) 0 > gdb_test "p \$_siginfo.si_errno = 666" " = 666" > gdb_test "p \$_siginfo.si_code = 999" " = 999" > gdb_test "p \$_siginfo.si_signo = 11" " = 11" > -gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey = 123" " = 123" > +gdb_test "p \$_siginfo._sifields._sigfault._addr_pkey.si_pkey = 123" " = 123" > > with_test_prefix "validate modified siginfo fields" { > gdb_test "break $bp_location" > @@ -143,7 +143,7 @@ if {$gcore_created} { > gdb_test "p \$_siginfo._sifields._sigfault.si_addr" \ > " = \\(void \\*\\) $ssi_addr" \ > "p \$_siginfo._sifields._sigfault.si_addr from core file" > - gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey" \ > + gdb_test "p \$_siginfo._sifields._sigfault._addr_pkey.si_pkey" \ > " = $ssi_pkey" \ > - "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey from core file" > + "p \$_siginfo._sifields._sigfault._addr_pkey.si_pkey from core file" > } > > >>> Can you expand on why it's not possible to have an anonymous union? It >> is certainly possible to have anonymous unions described in DWARF, which >> are then translated to struct types. >> > > I simply could not find how to implement it. > It might be useful to add to the documentation of append_composite_type_field_aligned() or maybe > better, to the comment in gdb/gdbtypes.h above the declaration of append_composite_type_field(), a > sentence explaining what is the effect of providing an empty name. > > diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h > index dd2d24fa8e2..e4fedd886c4 100644 > --- a/gdb/gdbtypes.h > +++ b/gdb/gdbtypes.h > @@ -2431,11 +2431,12 @@ extern struct type *init_pointer_type (type_allocator &alloc, int bit, > extern struct type *init_fixed_point_type (type_allocator &, int, int, > const char *); > > -/* Helper functions to construct a struct or record type. An > - initially empty type is created using arch_composite_type(). > - Fields are then added using append_composite_type_field*(). A union > - type has its size set to the largest field. A struct type has each > - field packed against the previous. */ > +/* Helper functions to construct a struct or record type. An initially empty > + type is created using arch_composite_type(). Fields are then added using > + append_composite_type_field*(). > + A union type has its size set to the largest field. A struct type has each > + field packed against the previous. > + If no name is specified, the type is anonymous. */ > > extern struct type *arch_composite_type (struct gdbarch *gdbarch, > const char *name, enum type_code code); > >> I think that the ideal user experience would be for users to be able to >> access fields the same way that they do in the code, that is >> `si.si_pkey`. All the _sigfault/_addr_pkey/etc parts are implementation >> details that could change. >> >> On top of your patch, if I just delete all the internal field names, it >> seems to work just fine, see patch below. In the end it models >> something like this in C: >> > > I am not against it. > However, could this suggestion be addressed in a different patch ? > > Simplifying the existing pathes to si_* values with anonymous structs would increase the impact of > the original patch, with potentially additional testing and carefulness required for others > architectures (for example, see gdb/nat/amd64-linux-siginfo.c L269). > > Matthieu > >> struct siginto_t >> { >> union >> { >> // kill >> struct >> { >> int si_pid; >> int si_uid; >> }; >> >> // timer >> struct >> { >> int si_tid; >> int si_overrun; >> int si_sys_private; >> }; >> >> ... >> }; >> }; >> >> >> diff --git i/gdb/linux-tdep.c w/gdb/linux-tdep.c >> index 4660772752d6..f21fa1e18578 100644 >> --- i/gdb/linux-tdep.c >> +++ w/gdb/linux-tdep.c >> @@ -349,21 +349,21 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "si_pid", pid_type); >> append_composite_type_field (type, "si_uid", uid_type); >> - append_composite_type_field (sifields_type, "_kill", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* _timer */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "si_tid", int_type); >> append_composite_type_field (type, "si_overrun", int_type); >> append_composite_type_field (type, "si_sigval", sigval_type); >> - append_composite_type_field (sifields_type, "_timer", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* _rt */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "si_pid", pid_type); >> append_composite_type_field (type, "si_uid", uid_type); >> append_composite_type_field (type, "si_sigval", sigval_type); >> - append_composite_type_field (sifields_type, "_rt", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* _sigchld */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> @@ -372,7 +372,7 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >> append_composite_type_field (type, "si_status", int_type); >> append_composite_type_field (type, "si_utime", clock_type); >> append_composite_type_field (type, "si_stime", clock_type); >> - append_composite_type_field (sifields_type, "_sigchld", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* Begin _sigfault's anonymous union. */ >> sigfault_union_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION); >> @@ -386,20 +386,20 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >> append_composite_type_field (type, "_dummy_bnd", addr_bnd_pkey_padding_type); >> append_composite_type_field (type, "si_lower", void_ptr_type); >> append_composite_type_field (type, "si_upper", void_ptr_type); >> - append_composite_type_field (sigfault_union_type, "_addr_bnd", type); >> + append_composite_type_field (sigfault_union_type, "", type); >> >> /* used when si_code=SEGV_PKUERR */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "_dummy_pkey", addr_bnd_pkey_padding_type); >> append_composite_type_field (type, "si_pkey", uint32_type); >> - append_composite_type_field (sigfault_union_type, "_addr_pkey", type); >> + append_composite_type_field (sigfault_union_type, "", type); >> >> /* used when si_code=TRAP_PERF */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "si_perf_data", unsigned_long_type); >> append_composite_type_field (type, "si_perf_type", uint32_type); >> append_composite_type_field (type, "si_perf_flags", uint32_type); >> - append_composite_type_field (sigfault_union_type, "_perf", type); >> + append_composite_type_field (sigfault_union_type, "", type); >> >> /* End _sigfault's anonymous union. */ >> >> @@ -408,21 +408,21 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >> append_composite_type_field (type, "si_addr", void_ptr_type); >> /* Since there is no possibility to declare an anonymous union, >> using '_anon_union' instead. */ >> - append_composite_type_field (type, "_anon_union", sigfault_union_type); >> - append_composite_type_field (sifields_type, "_sigfault", type); >> + append_composite_type_field (type, "", sigfault_union_type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* _sigpoll */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "si_band", long_type); >> append_composite_type_field (type, "si_fd", int_type); >> - append_composite_type_field (sifields_type, "_sigpoll", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* _sigsys */ >> type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> append_composite_type_field (type, "_call_addr", void_ptr_type); >> append_composite_type_field (type, "_syscall", int_type); >> append_composite_type_field (type, "_arch", uint_type); >> - append_composite_type_field (sifields_type, "_sigsys", type); >> + append_composite_type_field (sifields_type, "", type); >> >> /* struct siginfo */ >> siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); >> @@ -431,7 +431,7 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >> append_composite_type_field (siginfo_type, "si_errno", int_type); >> append_composite_type_field (siginfo_type, "si_code", int_type); >> append_composite_type_field_aligned (siginfo_type, >> - "_sifields", sifields_type, >> + "", sifields_type, >> long_type->length ()); >> >> linux_gdbarch_data->siginfo_type = siginfo_type; >> diff --git i/gdb/testsuite/gdb.base/siginfo-obj.exp w/gdb/testsuite/gdb.base/siginfo-obj.exp >> index 5e36b3340680..272d74ac2805 100644 >> --- i/gdb/testsuite/gdb.base/siginfo-obj.exp >> +++ w/gdb/testsuite/gdb.base/siginfo-obj.exp >> @@ -111,11 +111,11 @@ gdb_test "continue" ".*Program received signal SIGSEGV.*" \ >> "continue to signal, 2nd" >> >> set test "set si_addr" >> -gdb_test "p \$_siginfo._sifields._sigfault.si_addr = 0x666" " = \\(void \\*\\) 0x666" >> +gdb_test "p \$_siginfo.si_addr = 0x666" " = \\(void \\*\\) 0x666" >> gdb_test "p \$_siginfo.si_errno = 666" " = 666" >> gdb_test "p \$_siginfo.si_code = 999" " = 999" >> gdb_test "p \$_siginfo.si_signo = 11" " = 11" >> -gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey = 123" " = 123" >> +gdb_test "p \$_siginfo.si_pkey = 123" " = 123" >> >> with_test_prefix "validate modified siginfo fields" { >> gdb_test "break $bp_location" >> @@ -140,10 +140,10 @@ if {$gcore_created} { >> "p \$_siginfo.si_errno from core file" >> gdb_test "p \$_siginfo.si_code" " = $ssi_code" \ >> "p \$_siginfo.si_code from core file" >> - gdb_test "p \$_siginfo._sifields._sigfault.si_addr" \ >> + gdb_test "p \$_siginfo.si_addr" \ >> " = \\(void \\*\\) $ssi_addr" \ >> - "p \$_siginfo._sifields._sigfault.si_addr from core file" >> - gdb_test "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey" \ >> + "p \$_siginfo.si_addr from core file" >> + gdb_test "p \$_siginfo.si_pkey" \ >> " = $ssi_pkey" \ >> - "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey from core file" >> + "p \$_siginfo.si_pkey from core file" >> } >> >> Simon > Hi Simon, Do you want me to publish a new revision of the patch ? The things you raised looked minor to me, so I would assume that I don't need to publish a new revision. Please let me know if you think otherwise. Regards, Matthieu