From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id u875Oe5mZ2rkNzAAWB0awg (envelope-from ) for ; Mon, 27 Jul 2026 10:10:54 -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=M+vTQv4k; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=M+vTQv4k; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D22BA1E099; Mon, 27 Jul 2026 10:10:54 -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 [38.145.34.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 037911E099 for ; Mon, 27 Jul 2026 10:10:53 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 86AC54BB1C03 for ; Mon, 27 Jul 2026 14:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86AC54BB1C03 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=M+vTQv4k; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=M+vTQv4k Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c20a::7]) by sourceware.org (Postfix) with ESMTPS id 4E36D4BA9036 for ; Mon, 27 Jul 2026 14:10:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E36D4BA9036 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 4E36D4BA9036 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c20a::7 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785161411; cv=pass; b=RrsE4V8sJucdZ6ZvPpwM73N+iPAhx+5bImLWqH0c5uf7f6hFQBwMmk751M1tDHaTaUc/bBfe9wemIil/hylGGE6KefIbMzQBaUEXXpmbO3tiNA8lhdtFUSd68TMmOvcGa03bgYsL2P1eXjZQYTcS5rW2GPFiOymwJY54FtkjZkk= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785161411; c=relaxed/simple; bh=UDirZrlV2FnK7ZITZ8Uy0vA+uRCQkCT0Vi6GYxlQzaQ=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=a3tB4UzDb/OzydiLPpZyPAs921DB03VGrG7Rd6UgIwxT4RFjFb6wPsr0JrFDtNo1TKU+Dm23WTPERenEP8gb+UN4HSzGojVFBU4wpJtiRZiHrCI8NO+XPQ0KrTYmvknlXQ+qYoeZeOcmgXqMrvtA+2tsi39Os/ZmbQk18B/SCsc= 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=M+vTQv4k; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=M+vTQv4k DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E36D4BA9036 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=ucv5jpDa9TkFDv7IsgotaZLEJ3sfAIRz3KKQFvlbkzxP1eCcSe4gGzsSHiwVUlj7MgopNUWs5JZVImkSOUkIsZ3nSKHqvluTfRCSPVR73YNFYSCC6953bhDvgDLtpTKTKMhBk8MiRod4IDwYAMJpCCtPc4/tExmMx3Bs9qROElBDc3eWKxM+jD+Jw2NIdYbP9gqAgze0L5LYw2W9MIPnJx2TS7Y/rNxfBhOUk4QSnRliH5sYojwAode3cZLIEfwR8SmKmux0Zp5RLXNfPrbwBKDFkHUlryPIh1RjB3PtXENh08VGdWB5U3byf5Q9QXzNPijlV7tpjlfEjGler6RtqA== 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=jMQOuek9kZiUfXDP1FKaSwo1pcTOBrtJwFVFAUUT35A=; b=ffx2caJNLJ100thy6sCMsFlHFGAXzAJD/Lu3cs0OxilKxuXtMmIfng04TDgAntzwlYHLU9PvjBI6ziM6+AkWkd2drhjRQGw5lyV2POWdxoWBnlJuBhULbiSMhgidQug1X0nxcssgsR4MTJ2nKSIlpwWAiQTR7AVTrQIuW18gtWfyQ9YeA1G5CFzOhY7OxlpEjVW2EQBWWgS0Yy0kG1ZSkjhkf1MwMuArXiIqYypGlHdIylvAJJ4rxjU2EZI0s0yLOUG9Z73YPuLqRZt2GNqTT9MBQ/wpZG04lmpnwqkGFUS9HsJz3OZPiQ0UBlHxv4/AU6zSpRuinAfMcUT3D+tI+g== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=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=jMQOuek9kZiUfXDP1FKaSwo1pcTOBrtJwFVFAUUT35A=; b=M+vTQv4k0Wi51hJjA2hr+fn7c8JpUpnB0/ngyxiUytFi7QOIY/lB96FtdBRLWn2DhIyYJ2d/T5pcQmxN8YdcF/iV/nkHUpRq6M5p4KBNDZF3HAQqAAOwFl7+YS3m8H4H5OdWogXD0rxDeS5o92ba3p/tofhAOW+oc7/8XMaI/yo= Received: from AS9PR05CA0137.eurprd05.prod.outlook.com (2603:10a6:20b:497::35) by AS2PR08MB8573.eurprd08.prod.outlook.com (2603:10a6:20b:55c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul 2026 14:10:01 +0000 Received: from DU6PEPF00009526.eurprd02.prod.outlook.com (2603:10a6:20b:497:cafe::2) by AS9PR05CA0137.outlook.office365.com (2603:10a6:20b:497::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Mon, 27 Jul 2026 14:10:01 +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 DU6PEPF00009526.mail.protection.outlook.com (10.167.8.7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Mon, 27 Jul 2026 14:10:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HsaNjUmrsogJiXrdUh+gEmIpO55+PpFx5e3Al4It793nMsrTyhc1LrXyHx0+0OKGcE/L/UwYDly5F+TF5gJo56OoDH2G6G0SKspZ2QtB8uC9jxPZaIeTaUJ09d/xvJsuixTFp0fxPZ+t5HCNFq2TbVOPs48b2BYsRp4qMIowJaCG8t5iweXexY0Y5krQtsWRtkwIPdhooFi/CZG/WDds+hM0y45iATY8Ane7tZuQ1ci49rYMBkw3xag2kVMvsqcwrJl/0PLoA3Z2PGD6d/v1QOx59Kb/+fOmeKLELK7aOANCPk7byPY7cJ5FunkruoFzwbU709HfeK427P2nMfIOdQ== 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=jMQOuek9kZiUfXDP1FKaSwo1pcTOBrtJwFVFAUUT35A=; b=yrFPMUy2YZijeYGONQwNR/5e+jus9LQ7u6YRV9u4zG2W9b0hVNBd+gFO9gDXKQtx06/+leGsDAyOeGwEBZrU6xPsCFcpXO8dmOlHlZZYOFRiZMVAUUNjK6p6e6QRb6QbEGip7iJQaVlLWB2KlDh9suEC9dEoT/t90ZiOsFnwYbv/5IwpUr9AkxkxAiaTkKrXOtWfUPrYz7slDI7TYbGspXYY61mQEEW545a4rh0t5RS8OZNL4lTccWjYKAoXoQc3ufAktFSQg3aY/rtgjMh5RrCeqcDWfgotBG2yBxW/v5rOHVPDqFYxsbf/DXAgoVj1AHPDA8HPkh+VRUIX9KJzfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) 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=jMQOuek9kZiUfXDP1FKaSwo1pcTOBrtJwFVFAUUT35A=; b=M+vTQv4k0Wi51hJjA2hr+fn7c8JpUpnB0/ngyxiUytFi7QOIY/lB96FtdBRLWn2DhIyYJ2d/T5pcQmxN8YdcF/iV/nkHUpRq6M5p4KBNDZF3HAQqAAOwFl7+YS3m8H4H5OdWogXD0rxDeS5o92ba3p/tofhAOW+oc7/8XMaI/yo= Received: from AM0P190CA0007.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::17) by AS8PR08MB6439.eurprd08.prod.outlook.com (2603:10a6:20b:338::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul 2026 14:08:58 +0000 Received: from AMS0EPF000001B0.eurprd05.prod.outlook.com (2603:10a6:208:190:cafe::11) by AM0P190CA0007.outlook.office365.com (2603:10a6:208:190::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Mon, 27 Jul 2026 14:08:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by AMS0EPF000001B0.mail.protection.outlook.com (10.167.16.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Mon, 27 Jul 2026 14:08:57 +0000 Received: from AZ-NEU-EXJ02.Arm.com (10.240.25.139) by AZ-NEU-EX03.Arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 27 Jul 2026 14:08:54 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EXJ02.Arm.com (10.240.25.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 27 Jul 2026 14:08:54 +0000 Received: from PF4S4363.arm.com (10.57.39.25) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Mon, 27 Jul 2026 14:08:53 +0000 From: Matthieu Longo To: CC: Luis Machado , Luis Machado , Thiago Jung Bauermann , Srinath Parvathaneni , "Maciej W . Rozycki" , Matthieu Longo Subject: [PATCH v4] gdb: align siginfo_t with the Linux kernel definition Date: Mon, 27 Jul 2026 15:08:28 +0100 Message-ID: <20260727140828.68323-1-matthieu.longo@arm.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001B0:EE_|AS8PR08MB6439:EE_|DU6PEPF00009526:EE_|AS2PR08MB8573:EE_ X-MS-Office365-Filtering-Correlation-Id: e7079926-7ecc-4dc6-de54-08deebe8bfa9 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|82310400026|36860700016|23010399003|1800799024|6133799003|11063799006|56012099006|10067099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: G8/Ew9pd0kMNXJrgHMfXwTwtiGzXWiEDPJG04BJY3IVyY7jEQbVZjcPLQwXKsZKCrqIZZRidEbrf/rsU9UUmhPgdM+Rs39pmuFETQGPVtRRmuXRp2+dBFY6vE4W5Cv7k2PsHbu/Y1iuekPRcGnFBMcPCyS3UGBXrT3cakpUpbAN8c4vK2J0fPiDS+o/KOfjNqKD/Bl9nwFWQKEMSFTQi7OrF7Bouu+qcub4kd6OaQEuH2uyVeudy/lEO5GUPFTS+/tYBKwloHuMkPEW3+LWmzXc1W9EILe9vd5EWcMHNjhN3lzvMcxcPrbyg3QheoXecvsjfSaUHP54gslxrZzcY/N807Zkcigd+G8Vf7880+hbThkvQUxH+83ygzN33bja3MhABGGtnevPZgz4uVzRzlkslveSDyz3R6eXAguaupzScNmqr8oBbhgy4yqyk9xFYXigbvnJ/jtIwjwAIBG3lPVcWNASF6Qb5maX5/nWjnN2JbmtNMIRoPbWcUtqOtaYPofwTYe9PQWZTz/zEUN7cBvJqNB1Ldi7tpnG65LtLwvXzdRf8l1ubDQrTZ7FeDRh7jqBld6kwLzWIjkZNQTxEZvN1UO7RfJAmwFaTKqXiR70xCgnniSn04zTZYCPjwzbk95zuSYwOAUrBjxSytkLhw1JDEi62DZqk2HWd0mdhbSA= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(6133799003)(11063799006)(56012099006)(10067099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: rM+p8JUFPF4oNQ57CxkdpPSBxYIqbz0ShcJqCLPQoI4wviSYh/sH49cG5aw5JjpADxbjPwwip7mR6xzT8qS6VXVADfmdn/HSjjFE9L2vz3mfWBtALKa4EdG3m5pI9YHaPKlEm0vd+d/JQfBfE6rZRhgc8Gjnt8VJXlomo8TIBDTVv3mM9vMup6qZfIzgq1P+HBMnGyhSRb2Hh7VhqQ7r7IOvag1LS+ebsL/VLleWi8McUpV2iZupVJh0OilorTsbtPCK8cAtrOgFWmChws8UMJgmQoq8tfX5ST/mNAZgym0j/DZqHBb7AmwC0b32fgSvlbmQtLb379gDFzQV16iIDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6439 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009526.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5ea150ea-373d-4314-4638-08deebe899db X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|35042699022|376014|82310400026|36860700016|23010399003|1800799024|13003099007|6133799003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: TKdYRPVaygKeQwXBwBEs0ChVYV5IjBgvq7M6RlCp7u0E2jpRihDW5YE8q8AXXfL/FKT7SUYHWX22zGFK2hb8GxbUYPkUahLL9C99bcJRWfqKX5x4YM2EJu/jEWjq7ZS4vyS842SEhH7qYyLFyymhEQY0mh/+lwrQOS/XpTt90QUev8xaAQbVJg/VbGw8yqYKYJ6Rya3zI4/8sOkpRcUMep5Uh4c5eHDW1KC1zdKB0yeyknU99fSfq8lVi2C5BDcaKmHMkGx4umBUcwWNiXN/YofbRW49VI8pNmQ9Xgs7kLQZEtMW9ZcWBlZmQVigbv4k708xXfPRQ0jA00smiiJCx8E0/x8SvYV/36/K1BgpgrMIQ3QAyzEvktdPNAEs0na1ZYjciU/xGlUnPXnMuyqxsPTRhwd9FfrgMWtEVlIW6W8X47oR9hvIq2EJ3u4P9WkZd8NCbxDPhpWOJTNrOPJIVv518TPqo9tW2EfLpA9FUQZBfKRiepebJPmCC8Kw02CzqIv2nOh2e9qdrGWbuqbYTYBWjSpAVEJ2m5eNI3+dggv/HSQAz2NgBKoSUgWvvzs8NWxpDlVMu8N3XacZIvTvxIXu/2eE6sMvXJAgc5EgXS29PACVkCTOz1aOCKvgwrc23pEbFf7em8I32BkXJCUWxgbZdQippm29rLtUY8J07AA= 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)(35042699022)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(13003099007)(6133799003)(18002099003)(56012099006)(11063799006)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 090gIGytOB4KS/yek0Luc611fJJTEJEld8ad63nliOKH7ajBZVn/aRhIZq1zo4XE7Ik0K4IiBv+3nPvk536eJ9R57f2MQ00wrV/E8zQWNXWEZPEI0qyhUxwToMdaw+yBe9tsRlPCnv12LcvmrngRqf/U0iAvPKg3rRyrXFAto2st76WsVo4BH3Uae3cbobzOjvx86o6eJlsbN4stGA3jmQC9zUwker975xNQjuYKkqNWjvgHWGw4+yuL0shP1W5gaGyA2NU4p1InEcxLWlN/F+2A6VK4y3WkyI8GdChxYmQe7nmrBXYhdjQF+pay9adkvPHEPkSymnUQ7dPHZVfKqrUgplGmp8cKuQDRLmZgXSWZH6spQ8vtKyjcNmjD3gg9h3bvxnifVjGfY9ge+2Xv7bJjL5X+UVqXIad72xLZeg8lUmiSFYwBQe5adAO9rZwP X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 14:10:01.2602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7079926-7ecc-4dc6-de54-08deebe8bfa9 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: DU6PEPF00009526.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8573 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 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 | 7 +-- gdb/linux-tdep.c | 52 +++++++++++++++++++--- gdb/linux-tdep.h | 60 ++++++++++++++++++++++++++ gdb/sparc64-linux-tdep.c | 5 ++- gdb/testsuite/gdb.base/siginfo-obj.c | 1 + gdb/testsuite/gdb.base/siginfo-obj.exp | 14 ++++++ 6 files changed, 129 insertions(+), 10 deletions(-) diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index f11eccc1bc1..705460312cf 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -2683,13 +2683,14 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, try { + using gdb_si = gdb::siginfo_type; /* 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 (gdb_si::key::si_code)); + si_errno = parse_and_eval_long (gdb_si::get (gdb_si::key::si_errno)); fault_addr - = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); + = parse_and_eval_long (gdb_si::get (gdb_si::key::si_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); append_composite_type_field (sifields_type, "_sigfault", type); /* _sigpoll */ diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h index c19839fde2c..1dd0b3d2a17 100644 --- a/gdb/linux-tdep.h +++ b/gdb/linux-tdep.h @@ -98,4 +98,64 @@ extern CORE_ADDR linux_get_hwcap2 (); extern bool linux_address_in_shadow_stack_mem_range (CORE_ADDR addr, std::pair *range); +namespace gdb { + +/* Maps each siginfo_type::key to the corresponding field-access expression + in $_siginfo. + + Keep the order of key values synchronized with the entries in get()'s + paths array. Each key is used directly as an array index. */ + +struct siginfo_type +{ + /* Identifies a field within siginfo_t that may be referenced by name. */ + enum class key + { + si_signo = 0, + si_errno, + si_code, + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */ + si_addr, + si_trapno, + si_addr_lsb, + si_lower, + si_upper, + si_pkey, + si_perf_data, + si_perf_type, + si_perf_flags, + + /* Sentinel used to determine the number of mapped fields. */ + SI_ATTR_END + }; + + /* Return the $_siginfo access expression associated with ATTR_. + + ATTR_ must be a valid si_* key other than SI_ATTR_END. The array + order must exactly match the declaration order of the keys above. */ + static constexpr const char *get (key attr_) + { + const char *paths[static_cast (key::SI_ATTR_END)] = { + "$_siginfo.si_signo", + "$_siginfo.si_errno", + "$_siginfo.si_code", + + /* 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", + }; + return paths[static_cast (attr_)]; + } +}; + +} /* namespace gdb */ + #endif /* GDB_LINUX_TDEP_H */ diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index cb7ce41e5cb..c4c4b8789f2 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -134,11 +134,12 @@ sparc64_linux_report_signal_info (struct gdbarch *gdbarch, struct ui_out *uiout, try { + using gdb_si = gdb::siginfo_type; /* Evaluate si_code to see if the segfault is ADI related. */ - si_code = parse_and_eval_long ("$_siginfo.si_code\n"); + si_code = parse_and_eval_long (gdb_si::get (gdb_si::key::si_code)); if (si_code >= SEGV_ACCADI && si_code <= SEGV_ADIPERR) - addr = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); + addr = parse_and_eval_long (gdb_si::get (gdb_si::key::si_addr)); } catch (const gdb_exception_error &exception) { 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..5e36b334068 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._anon_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._anon_union._addr_pkey.si_pkey" \ + " = $ssi_pkey" \ + "p \$_siginfo._sifields._sigfault._anon_union._addr_pkey.si_pkey from core file" } -- 2.55.0