From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6zD4JIDbYGoDoCUAWB0awg (envelope-from ) for ; Wed, 22 Jul 2026 11:02:24 -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=bhHn9iO/; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=bhHn9iO/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 72BE81E09E; Wed, 22 Jul 2026 11:02:24 -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=ham 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 859441E099 for ; Wed, 22 Jul 2026 11:02:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7CA64BA23D4 for ; Wed, 22 Jul 2026 15:02:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7CA64BA23D4 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=bhHn9iO/; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=bhHn9iO/ Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::3]) by sourceware.org (Postfix) with ESMTPS id C81E44BA2E07 for ; Wed, 22 Jul 2026 15:01:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C81E44BA2E07 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 C81E44BA2E07 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::3 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1784732511; cv=pass; b=fndqZi66/eh2egw0DjizI3eNzyLYwGvrl74ju8PGB8st4dmzUlNCWKL3OzIKrNi5BoxuspTmhnr+rUW1F96nDTUZse6F8AE4poh7XmfEAtrI1VeN1W7gNx0eeAkUdPMAsHKDSA8yRku3gTt0Z+mwfZAZom6X/iaW2YXpbJahUDU= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1784732511; c=relaxed/simple; bh=L5tH99fCyc/mgJ0OFH06d9ROcPLahsQzZ2xXnf9k79U=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=SpA1b/pJrQdRRxvuwvpo1WG5w/Ki49FZh6Fku35Q7rHRGrZIUhY0f6g6pDdHyMMMhqlgazuXXyAiNcsR6/YgG+Ytz4z1rnR4eaL42Hwh8ajrFBnXTe4GvCDMR4gjLdlltO8gEYYpFb3k0gp7V30R0fWXLA4QIRl84M+sTSNPWoE= 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=bhHn9iO/; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=bhHn9iO/ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C81E44BA2E07 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=MfxKaIMAAB4oqJTTWq2RHhRmUiXPOwToOiFspiI7G4SJx6gzVFbIKibqISKdo68lKYofGj/vo33/DlrBINKt/0/AlkBPvc5mAA7In9ROtCCUdMADQ5YSIcGQh3A7c9aBtBIbUMKZKykjIF9JcTBAiXROodqd571tF33CSO5StCBqJQCXdrLvGPKLD1EiCkEMuqit3gR5A0Avq6UoUKcRkNUKn2TpwpDSc1eiuxYHls8o0wdsVqKxFeCC3l/Rr92f9BbHddcrf13PpYvzfekZK/TQ2KUgfY+1xwjy4EcgkNmDXfWstCoOz0WKRXrzB1hTs3PrX8sglshxBkZ3Y7m+Xg== 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=aiWLY+FTw9/s6hBQBGZ2zCHZw1NvC742Eb88UDBD3sI=; b=ewxGGiixYEARGE65O4JwggG2vZq7/Iw/vV6ghc6sfEgImxAq/iZVohwFoliViG+jLMH5/0ei2SJ0WYpcPPO2DEOO6kA8iUsOm1bt83C0TFRn9lMDtPMODk90byEw3OkovsGwH/xjQ4E5wOOdwB2x9Zl278n+zTi4TBq3mrEHf+ii9/lPxPq0oyd8zWWQ75URGTdc99A1GCKh/msz5FtTRFayBKU5CsSvzqhOk3nVZb5lp4t7UOVsWSYTFwMQRFYpXAtO8oAhTFlLdUBXVUmGdWjVZG9HeNTFh3xSjM+JJV2qk1VLb9VzQ042VeUQDs2QO4PAqGZcZIdFf8FYtO95+w== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gmail.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=aiWLY+FTw9/s6hBQBGZ2zCHZw1NvC742Eb88UDBD3sI=; b=bhHn9iO/Dkj/kzPcCks4fmDMfZXfPK89H+vqD4s9pm6c2I4S0DqQagiH81uOzVKSveTOFg+GH9NHYgH10KQeuY9OZ6hS8o3YgCgK+cUa8EyWCPs0g2MyIl1y55TXFKM4kTkETHpnARY0yPbB0nMOBQ4WmH5waD5qJW/tIiqP/ME= Received: from AM8P190CA0003.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::8) by GV1PR08MB11208.eurprd08.prod.outlook.com (2603:10a6:150:1f0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Wed, 22 Jul 2026 15:01:42 +0000 Received: from AM4PEPF00027A60.eurprd04.prod.outlook.com (2603:10a6:20b:219:cafe::57) by AM8P190CA0003.outlook.office365.com (2603:10a6:20b:219::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed, 22 Jul 2026 15:01:42 +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 AM4PEPF00027A60.mail.protection.outlook.com (10.167.16.68) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Wed, 22 Jul 2026 15:01:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u4yeTETJvxkNDXn9S/qyytz8+xC0VEd9AWDQy5FM17WOpIkJ6y3TnltM/b8B/q3wvztMWdtH2BWddjmSs/PtcGJj43YbXGR4bkn/Mc7Rg1IUHzQa3xY5KjREoDnE6aZVdjPAvxLV52RNYHK74ZAH2Ci04HUKwV/LAqajatueB8ZTlLAZ4mggCSBWLoqGtnK+c0uKOdhoBwKwnJdpfyygr9lBS3GRDnv2WDQWpugDsoQ2c/rPelkR6XMDafIKTELGkRleTxt3+JSv834ytFtfw7zjfjdCwmzTkAAMIsx9bM7Jog9amHjxdFsqyAoNBf0bq228GHnz7MPqPVpNI8l1FA== 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=aiWLY+FTw9/s6hBQBGZ2zCHZw1NvC742Eb88UDBD3sI=; b=Mp9Z+CgokObxWW14XvEhF84ZzHVfLlaq8YvLv5nU/XBkpcl/izRkJrYvU1q6xBbLr/d61LC6IsKCc8J+jliJK9m+No88FmIO+4mVyF9PF0jf74ekeEUh3G8f78RfFWAC6fTnXbnCbQq5nRcA3IgXwRbWAZ3cUVvW+eutx3MehGZ/hPyRN5QO4h4fxbbFge/tmAa0qVJs+FbxeVFUccZ1GiZX8lnCeZG9Be7xoPM3LjGZNAnmfIUgaD/lUmh2XlgnKHy+nSRssq3KQwtCYycI2bhK7OoMBKW61nJg/sn2lfYI+jdMDoh+klbvS4XSIGnQ9Samgt0Xz24FShGs0EY+Hw== 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=aiWLY+FTw9/s6hBQBGZ2zCHZw1NvC742Eb88UDBD3sI=; b=bhHn9iO/Dkj/kzPcCks4fmDMfZXfPK89H+vqD4s9pm6c2I4S0DqQagiH81uOzVKSveTOFg+GH9NHYgH10KQeuY9OZ6hS8o3YgCgK+cUa8EyWCPs0g2MyIl1y55TXFKM4kTkETHpnARY0yPbB0nMOBQ4WmH5waD5qJW/tIiqP/ME= 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 AS8PR08MB8328.eurprd08.prod.outlook.com (2603:10a6:20b:56d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Wed, 22 Jul 2026 15:00:40 +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.0245.009; Wed, 22 Jul 2026 15:00:39 +0000 Message-ID: Date: Wed, 22 Jul 2026 16:00:38 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] gdb: align siginfo_t with the Linux kernel definition To: Luis , gdb-patches@sourceware.org Cc: Thiago Jung Bauermann , Luis Machado , Tom Tromey , Andrew Burgess , Srinath Parvathaneni References: <20260702165231.331169-1-matthieu.longo@arm.com> From: Matthieu Longo Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0014.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:150::19) To DU0SPRMB0014.eurprd08.prod.outlook.com (2603:10a6:10:350::5) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DU0SPRMB0014:EE_|AS8PR08MB8328:EE_|AM4PEPF00027A60:EE_|GV1PR08MB11208:EE_ X-MS-Office365-Filtering-Correlation-Id: e136f08b-5a44-4668-2df2-08dee802242f 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|23010399003|1800799024|366016|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: wWXc4xQxDM5TSJVDHsJHw68oq8kLG/tDsaw7lQhxjgGlue2kpOe7SRNXhTJ05EpgZST8/SljD1U+3K9n6f3FNzfLw7DbMmtqRq1YtCfOhyNoAoTwx7T8NSvl8aJCTFDZxh5sISl38p7QL1Ekhzb93z9G15TWlYGlD+QRJEbsoEnrFfKVer8kXnHHMWQuANp+1HrCEUQWdZ2bqLnt2dqjE5B6Edg40CWoJQnwcVfp7QdKyXglweSnE5B61aCCsehF01W3TMOEeAYfEMVeVy50fpBhbbP+VvGGS5ODxlVxcwuFEgTds6FLRSEFKPM1Bi68UGoqIlzeN0AHanVgMTLA2c5cvkAD7SLZ3hSNaV//sn/UDlypjdKGn3n6SHbo67oZ5wY8bDw5s7guYDDsSfBadzpqn12F6vPGeqmO7Y5S2u0tq4NawTpWPjVXsmxWSgIl/tCV61Sw2DtIX6SFWN/BNgeUa7M5Q6C/0FZFemHCMcYpmC/9b7F6JOshHnM4v9fmQejw1Pv97gvB/UsirNTj74DtQkd/ePfI3ZYl4/CE7xksLhKlRYmY3ZLsqFPb2hbyHERiSj870U8HowCfGCFQ9j++nZoq5hguTC6Wj2sqJwxUFqiME0yYPi3Ucjg6rErcSe8NY0qq8gKAU5qRq7/kPUZJvBWzppeH39QFp+YXxdM= 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)(23010399003)(1800799024)(366016)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: DQZXK5EzASHGMwZCZffYXfY9TJFvO1VaI+FGsnodBmg9JgBWRBr4JvHSCuPMoFB/l8aQb6aY5mbODL4qtTLk4NN6L4ilq3KI6yv1DRoFaApD9/oFofxI6Al0GpnP3CxjADvPCtp6hw5ScXv+oKLaulpd6mFT4fMQgnaMVuEfqXLaHxnEGLkFARquz8F1MDnb6LoOu2hmrC3/aEzYFXnBuubeXmQIL0DKfHn0gk/b7dHOaulgQNpi5794ndXWEiVDklNHUmxrMCVV19+oHJ3ygy7Nj0ebvuG5qI9V5IvTivWhXh98JyppXBlJrWEEaroud1OfDhmcvhfFJ69XIJswVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8328 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 29896099-47c2-4c37-48ed-08dee801fe4f X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700016|35042699022|82310400026|23010399003|14060799003|4143699003|22082099003|18002099003|10067099003|11063799006|56012099006|13003099007; X-Microsoft-Antispam-Message-Info: 6GvnyE28dn6d0s5C52Nowd4Fi1HlnAI5XaC+BlNPmZ7breJM4nG/WlVcHARssaRCG2AtLq4ZH2cJvqzcmuat7c4O2nGXCUs3actKUxblcQfo60YivRiKBfxcUlFjTZ4+46xdGEYjbKcSphTYmXdiEq0TuzI3fAFkCRrJrlsZ9jD0+HgYPm5MQkkSI2upPXn+sDUN//var95Li6m4aIh/4VZhPjmGMb9aFoqcq+KKFcx736TxaLCBSJ0kaL6aaxmkfOZbGGMrIYZikOaWr7YQMJM8gtXirGi5g/piGIN+VjNwnsujFi6pky/qV0zCGM3KZCGx5ReQguRMkdPAX0yZFwgh4rvHZRqxNkHPGk2t7XQkkg4doHxH7osmFdDp0dEJt9I2uPCoiBmfhjyQuzaLl+gFhnkeC5FGui/ZepjliCUB0I01hnLZE3aIJ9/KXOYHL8M1ySgfk2cRTkztqIsJ4BKeuwxkCSjMC8+3nO0MFY0RVeLXEqln4BrDfNueTJHhNoCcc5hv633gGPHSi8ZKuU04OR1z6N0+UiNmzzoEztn38kuJCZtl1U+suG+aIacB+CP+tsPMtsYDK5Gb2d5Sckucc9ec1DE3QYkeTrhTQVXLXsHH+suqHFpMTh/b4iQD7hPPNjmLRkComJfDSesRUhBfMkWr+03n3ZMjA67D0uVdQlRSIfy3nJX5PeIQ5cN2137yKMa1AaSoIwEvvCjWSA== 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)(376014)(1800799024)(36860700016)(35042699022)(82310400026)(23010399003)(14060799003)(4143699003)(22082099003)(18002099003)(10067099003)(11063799006)(56012099006)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oJGZFb9ci/2ygv3x2oqtDSkHAtlz2IfIKdLLQYiV03/Ll14zOzXsSCgOnF77n4qCQcl4662fBUmlc4U1ffo1BNunmnTzTSz1wbT3Pxkg8MtkT2m26Acx8kapPi394CmkOzBRLXrr23uQrSeRQ2z5bWxULlcubvmZzI7BbJacE3dRmU66oEuExdUIuDejeStBf+1y7eY66FN+ykMfUNpF0P0UDLG6r38MiPMf1RzFfgcuxfvQYH6WxK2Emgk2bY2+89MStUW6uwfV8ImTAMA+Y+JEM4EmCog/5Tp3rM1T3KinFDRxBJ0lgKxij6r5FfEMbvsr2LSowsmbIWzBt7Ds4SgQ9rmg++EbxGICx9XqhGhtzq4e/AvMyqNy2EAQYN07hDHZooTROuh4kNSyC81+obaISp599wP8YN4yW7wTAsciiikNvBeB/phAFHRqOlQt X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 15:01:42.6511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e136f08b-5a44-4668-2df2-08dee802242f 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: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB11208 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 21/07/2026 22:09, Luis wrote: > On 02/07/2026 17:52, 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. >> >> [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/linux-tdep.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- >>   1 file changed, 44 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c >> index a7381677498..d5b0e6e7011 100644 >> --- a/gdb/linux-tdep.c >> +++ b/gdb/linux-tdep.c >> @@ -275,7 +275,7 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) >>     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 +285,21 @@ 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; >> +  struct type *unsigned_long_type = builtin_types->builtin_unsigned_long; >> +  struct type *uint32_type = builtin_types->builtin_uint32; >>       void_ptr_type = lookup_pointer_type (builtin_type (gdbarch)->builtin_void); > > Nit: Blank line here for cleanliness. > Fixed. >> +  /* Compute padding length, i.e. __ADDR_BND_PKEY_PAD.  */ >> +  unsigned alignof_void_ptr = type_align (void_ptr_type); >> +  unsigned padding_size = (alignof_void_ptr < sizeof(short) > > Logic: Are we mixing host-side sizeof (short) with target-side type_align (void_ptr_type) here? > Yes, you're right. Sorry, I missed that. The below should be better. --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -295,8 +295,8 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) /* Compute padding length, i.e. __ADDR_BND_PKEY_PAD. */ unsigned alignof_void_ptr = type_align (void_ptr_type); - unsigned padding_size = (alignof_void_ptr < sizeof(short) - ? sizeof(short) + 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); > Formatting: Space between sizeof and parens. Multiple cases of this one. > >> +               ? sizeof(short) >> +               : 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=BUS_MCEERR_AR or used when si_code=BUS_MCEERR_AO */ > > Nit: Odd phrase. Maybe rewrite as... > > "used when si_code is BUS_MCEERR_AR or BUS_MCEERR_AO" > Fixed. >> +  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 '_' instead.  */ >> +  append_composite_type_field (type, "_", sigfault_union_type); > > Could we name this in a better way? Simply using _ is a bit strange. > What about "_union" ? >>     append_composite_type_field (sifields_type, "_sigfault", type); >>       /* _sigpoll */ > > Do we need to add some extra tests to validate that gdb can read these new fields? Indeed, I can add some, but I would like to avoid adding a test for all the new fields. Can we stick with the original purpose of this change, i.e. adding si_pkey ? diff --git a/gdb/testsuite/gdb.base/siginfo-obj.c b/gdb/testsuite/gdb.base/siginfo-obj.c index 43dc979bc50..960e5b8e9cd 100644 --- a/gdb/testsuite/gdb.base/siginfo-obj.c +++ b/gdb/testsuite/gdb.base/siginfo-obj.c @@ -35,6 +35,7 @@ handler (int sig, siginfo_t *info, void *context) int ssi_signo = info->si_signo; int ssi_code = info->si_code; void *ssi_addr = info->si_addr; + unsigned int ssi_pkey = info->si_pkey; _exit (0); /* set breakpoint here */ } diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp index a94bf0e33ba..6c43d30b7b8 100644 --- a/gdb/testsuite/gdb.base/siginfo-obj.exp +++ b/gdb/testsuite/gdb.base/siginfo-obj.exp @@ -78,6 +78,14 @@ gdb_test_multiple "p \$_siginfo" "$test" { } } +set test "extract si_pkey" +gdb_test_multiple "p \$_siginfo" "$test" { + -re "si_pkey = (\[0-9\]\+).*$gdb_prompt $" { + set ssi_pkey $expect_out(1,string) + pass "$test" + } +} + set bp_location [gdb_get_line_number "set breakpoint here"] with_test_prefix "validate siginfo fields" { @@ -87,6 +95,7 @@ with_test_prefix "validate siginfo fields" { gdb_test "p ssi_errno" " = $ssi_errno" gdb_test "p ssi_code" " = $ssi_code" gdb_test "p ssi_signo" " = $ssi_signo" + gdb_test "p ssi_pkey" " = $ssi_pkey" } # Again, but this time, patch si_addr and check that the inferior sees @@ -106,6 +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._union._addr_pkey.si_pkey = 123" " = 123" with_test_prefix "validate modified siginfo fields" { gdb_test "break $bp_location" @@ -114,6 +124,7 @@ with_test_prefix "validate modified siginfo fields" { gdb_test "p ssi_errno" " = 666" gdb_test "p ssi_code" " = 999" gdb_test "p ssi_signo" " = 11" + gdb_test "p ssi_pkey" " = 123" } # Test siginfo preservation in core files. @@ -132,4 +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._union._addr_pkey.si_pkey" \ + " = $ssi_pkey" \ + "p \$_siginfo._sifields._sigfault._union._addr_pkey.si_pkey from core file" } Matthieu