| Message ID | 20260825100912.514232-6-matthieu.longo@arm.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A41C74BA2E17 for <patchwork@sourceware.org>; Tue, 25 Aug 2026 10:11:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A41C74BA2E17 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=JHhFsPgu; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=JHhFsPgu X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013021.outbound.protection.outlook.com [40.107.162.21]) by sourceware.org (Postfix) with ESMTPS id 93FCB4BA7995 for <gdb-patches@sourceware.org>; Tue, 25 Aug 2026 10:11:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93FCB4BA7995 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 93FCB4BA7995 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.107.162.21 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1787652677; cv=pass; b=f4AmxcEf+/pxJy94MAxf4o8+FRbiZJCjWQrD14w3JBVJJ0m5A4JY4Oxi6PrY4p53GcIRKjHmOmRiWga+dlBCmml15ANBMqnsCAAqqWSldC/7RxAOxblqttQMOxJknddm/54EQk+cslTHk77cCTb/ki0rurAuZ0GXQLEKPZXbI7A= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1787652677; c=relaxed/simple; bh=Z+aFS6CYAcpewa/ROwHg9MwQrzfh4Wohn8E8LG5D9uU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=k/xXV8hn76t5bjqHSpegpQuVkSQb8YhGIeMfoENOxlwXl2gMhFSIU8v07GUWD5+GaPFtyRsgft5KGBpYm8VR8Pn1xLo+8r9oh4wWQulGauXEMHIY5GnURxbShuL6utQbWyO5XvEXFtPVhOoeEtkXiQ1PYX3tJrYQxFjB0p2VkPc= 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=JHhFsPgu; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=JHhFsPgu DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93FCB4BA7995 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=JMECGFbk74oShn7xbiSjpkk4EzcX6qxwGAxe2i1rKSC2yiftDD0shHqtF0LiaI+J7U6v5FJn83JeQKHjYvK3dLvxG59TY9h1GsDXLhP/FDma2HG4iWUYUVUhTJELcTEyh8MwjA7bJRgPSjjx3DnAjhPcMpOZ2M+MQIaRM1xuqSzQgnOvVXtBho+3PdBD9ET04HWvjb10jnwFKzCZxHhGrnZG2QzsZo/NLdNw03tHSVqCmt343rEN74mdNzb13zqXX/MV/75vP4a18f0306/p/Ev9L7BXMfpQVH3JLjDj6xn52WQhXmNoLUvf+eTmlsrwWei2lcGY1rwvpa+BU4oZ6w== 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=S9dSJ94q5vSYwGadamo/hkneJDzcKozLebK0A/KkzEo=; b=jRb65KpHvMT+6Vu/twOrE6PxO+cbPrlhBluB5VGzzt2QQu7+k35BbBOBB2rEOE56o6WdNGSzC44IgDAD++8eVtDulp8ceT84oPvLNbFBfKetNmVi1QLuOrqv7fPd2zVaDFcdvXdoKru+TaLQMn+HzQU5ETVzivSdUwBEr3Dr3iqp1usJaKakj9CeaMK8Q5YMXwTU0AHI2lTLI+pkXt/roCrpjdFbkrr2xtO2Gt8E/2es3xq+9udGw7kmwAUxEkkN1ltQ0TDL4tZlmzYEX/ZrWn3h+Bn1tLDr2kWTIGBMn1THQgQQ0d7o0SZ6tBrhMGA2p7K7t7mhXQ5UoJT9PC+6VQ== 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=S9dSJ94q5vSYwGadamo/hkneJDzcKozLebK0A/KkzEo=; b=JHhFsPgubo8CS//TbX+DgahGzY1XKQllCgRXmc7kh3RlZnLDlZ1gusdTqR0q0w+eeXQKz/a9TzBwN4tgNn+LP/+x66f4Vy1kUEhzolrX5opeQqat/bc9Y0Japgs5s1uWW+7GQroEsprPWe8MJGAyxhu+frTdmZ8TcnG5V/mcO0s= Received: from DU7P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:54f::8) by AS2PR08MB9200.eurprd08.prod.outlook.com (2603:10a6:20b:59f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.339.12; Tue, 25 Aug 2026 10:11:09 +0000 Received: from DB3PEPF0000885A.eurprd02.prod.outlook.com (2603:10a6:10:54f:cafe::6e) by DU7P250CA0014.outlook.office365.com (2603:10a6:10:54f::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.339.12 via Frontend Transport; Tue, 25 Aug 2026 10:11:09 +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 DB3PEPF0000885A.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.3 via Frontend Transport; Tue, 25 Aug 2026 10:11:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MbLuuDJhkKvusdamEVczfxuM889iYn3q2dPKsg7QVodIQJHbhf7S4pV61PhVuHtynMYLcEEUbxFC9aCTMZBRTDclff6sunsUaZJ8psM6DlCVN8dsC7g/bYdZ65cxyHv7tQKMn+YYRwiTRk4W7aOJfM2GJ9cvcmO5qq5sicqj96+Tf6RJZ6KYYyocUfzeh5wWZH2ekXw995tlgWjZW9g3fYsj7+5YFnfVdi77aV4Vx+AUX/YuXeOBGZmn5kB+qghOut2Y70Fs5ROogZLcY2XJi6fbMZiVSgJghrDHN27XoMtSBDVCVcq1CY4n0pe1pkmSu7ntzLiXzZgAvfXiAE6glw== 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=S9dSJ94q5vSYwGadamo/hkneJDzcKozLebK0A/KkzEo=; b=NCOc28kBIRBNelqE3eZjVsoDScLrCYQ9o53KQQtumOCD4H0Wjs7PqXXG5NdyAa2sOnFB0BZf3ry6yVId8cBkf7gSwhQE68+0gU8V0Pisj5h07JwXPXMgDBWh28RiPUaz/X9PKTiXcd6kcmKDqQcWhuqvxfY1yvMmKig0L5AtNhWbXJKpUsPsQz5pHaI2QM9M3CLDvE2P9UZRxHiKm1kQtPvL/KYm8IuQhSEDdR1ZSxEAxHPyjqeXWGvocS9xUVgiA89ZQ2G7/240OJLjzv0/l3HvBDPHC25P3GV94yLlKx4c+UEBZPphjnVPhkD4T8i9KOoa5YdQc4Sg1onItyyNKQ== 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=S9dSJ94q5vSYwGadamo/hkneJDzcKozLebK0A/KkzEo=; b=JHhFsPgubo8CS//TbX+DgahGzY1XKQllCgRXmc7kh3RlZnLDlZ1gusdTqR0q0w+eeXQKz/a9TzBwN4tgNn+LP/+x66f4Vy1kUEhzolrX5opeQqat/bc9Y0Japgs5s1uWW+7GQroEsprPWe8MJGAyxhu+frTdmZ8TcnG5V/mcO0s= Received: from PR3P193CA0012.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:50::17) by DBAPR08MB5862.eurprd08.prod.outlook.com (2603:10a6:10:1ac::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.6; Tue, 25 Aug 2026 10:10:36 +0000 Received: from MI3PEPF0000848E.eurprd03.prod.outlook.com (2603:10a6:102:50:cafe::41) by PR3P193CA0012.outlook.office365.com (2603:10a6:102:50::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.6 via Frontend Transport; Tue, 25 Aug 2026 10:10:36 +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 MI3PEPF0000848E.mail.protection.outlook.com (10.167.240.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.3 via Frontend Transport; Tue, 25 Aug 2026 10:10:35 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) 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; Tue, 25 Aug 2026 10:10:09 +0000 Received: from PF4S4363.arm.com (10.57.48.229) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Tue, 25 Aug 2026 10:10:09 +0000 From: Matthieu Longo <matthieu.longo@arm.com> To: <gdb-patches@sourceware.org> CC: Simon Marchi <simark@simark.ca>, Thiago Jung Bauermann <thiago.bauermann@linaro.org>, Luis Machado <luis.machado@amd.com>, "Luis Machado" <luis.machado.foss@gmail.com>, Christina Joos <christina.joos@intel.com>, Kevin Buettner <kevinb@redhat.com>, "Matthieu Longo" <matthieu.longo@arm.com> Subject: [PATCH v2 5/6] gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t Date: Tue, 25 Aug 2026 11:09:11 +0100 Message-ID: <20260825100912.514232-6-matthieu.longo@arm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260825100912.514232-1-matthieu.longo@arm.com> References: <20260825100912.514232-1-matthieu.longo@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: MI3PEPF0000848E:EE_|DBAPR08MB5862:EE_|DB3PEPF0000885A:EE_|AS2PR08MB9200:EE_ X-MS-Office365-Filtering-Correlation-Id: ec5488ba-d1e3-4046-d3c2-08df02912f23 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|1800799024|36860700016|23010399003|30052699003|6133799003|10067099003|56012099006|11063799006|5023799004|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: fMfyZZqs3Trn8bTuw8Cjf9+URQzJmG69j2/AcLFIMSGnONLNMj+3g2k0t4LJCLfS5x8wZ/lUZgQmhSJtcsbS6mxC/24Xw9vrxwEHsPg/NSlwdcSNJDcb8QM8v8NOkexGTx/y46LnZkzRqn8w8zE7THozbXrO0ZSwot5V0hI0BMslcdVscqRRDdnbV0zg7+OTVJf9OT3W33r+bkc1K+Gu2H6JSMQe9YDfa3W3pZHfWarCjjaY5gErjYsm3jn3VtWCQl+gzSshQbSsKtqXfn7Z20YXyNe4oX5XGXOG9rqORTAhsC5Rvgru9kTvrrSnMo4HuVJGHsXPKmJYfiuSMqrVmAkaw5tj/0qtW1+xGPXuxgx3BEllboxgui+Cp6tTtHX91HwVqfmtL2vhn08pAjoMUz5w9f86rxN0kLCyyN8vUWumYSP/DHYoE9BE640AU1JrsvLQ/fzc+QgI1ILkpGncnmjKNv6t5gG2XiMuw4XIC8EbWju8W7mgbpv9UVHM+OLmuT0ijyHXSuqH7JgnO3NXZ7FL90Qf24sI4+PaQSrcmOr5omMvK0GiliNFpLVyUDS8/GZUQIh/Hdoa96wdozQsbOSrO/fLpfD0Yp5Wz0yAwsoqfmGKDfl3p6nzB119SX+QSGChUKMUaj8RHk2kxKhz+XFNSSOMcBFinxzUrNxm1+NRsNh3o0MtPC+A9pS2LkNBt20w/KhXU3jOjGJhDV17IQ== 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)(1800799024)(36860700016)(23010399003)(30052699003)(6133799003)(10067099003)(56012099006)(11063799006)(5023799004)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: pg8rn46eTjFF+AVm/MeE92kwprXtdaaRBMjNQxd8wkmh5b20Lq9M7Jh7H1ddsbPjQBxfrLAK8dkQEEgk4Lh7zC+P+7xc4FcQgXApZR/3jePVl36CShqWS9U9xiL3xorFkKkJtm76xTg7iaaSx4Ol65DL6H7mrWITwiYAQ1LNETVFpL1/FmlOrr2c+aZsYi6n+I6bFX23D7QeyO629BgBhAOHfBoH45tgS3bL1yKAsLRqE2C/vrrgugTFkNEJtepsyNbHA3IzGwcu7ET6c6japVWMhfMziFhpZAizft/4s/JfoAovnXSbamgbxoyKrMt4wDhgSmyYChPS2fZOWT5yAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5862 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB3PEPF0000885A.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6b828672-581b-4316-98a3-08df02911b00 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|35042699022|14060799003|30052699003|36860700016|23010399003|376014|1800799024|10067099003|6133799003|18002099003|22082099003|11063799006|56012099006|5023799004; X-Microsoft-Antispam-Message-Info: TMgBjcPQ73EvY//UYolp/tEjmi8nzveZpboGYPnMX3++C3LeyMEZVTMQIV1y88ZOKJhocPBhPKdh7sAXD7LYLHCEaZAIzSkAhxv1Gwwzr9jTKTLlC8sZXkjag74uR9bp9eqrhEs7ANn+/5hGoO3nc3mUacDJ0TsTGFyIHfAlGUd4VMm0E4Eh34NXtN1auJ4SBETj7uysSMcW4RxEevBzt0+8MS4BhdCxvc5XpgWtYwx9ixNNMLXQijCe84oZMV0wamNOtYDQJj6CFeW6YeCf/7/EZWuj4mRVTMdEp3izIyYrtuQPAXYYbk49GqJHbke89ABpcCCx+oQIr4vyfFRwsazYzans79QCA3DZQ4MKPNTXJHSkBemosDuCtx5dgNDeWven7b/ej4uTZAeas4a9plo4Fbj3UtTbMrDQHFoF6h3nPEp8GUiqwvh/ZCJXpR0iQboQocFV13UKfKZc6Jx+BvJvey6olyLhEoDPtsstDlGVoi0mIOnQrr3RAjJv8osRqZR7S2OZliB9gz89JLmqIR5sVXMaBhl5wxr5W08dyqLspQ4IENw2rArXwfnw32iFm59lN6//NLQG4io6YEb6ORqvXWzUPWRBxq2FpvX5eKBRECQJ/O1BpnmyWakPToWj/sUM4znsmiHvrHO2gf/FfQyMp+99B/qR7DTMLJPRHfIMDUWkcJKZLCwyLnigoLGxniuAmU6aolUj8yjNga/ayw== 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)(82310400026)(35042699022)(14060799003)(30052699003)(36860700016)(23010399003)(376014)(1800799024)(10067099003)(6133799003)(18002099003)(22082099003)(11063799006)(56012099006)(5023799004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zIG7P1ADtbO5SPOWkI+IM1sgeQtrvUFpfKsDtNclFTq1YcGFKAQgMm+7fIjRrpf25VjpHJngslus3x2Q6C2Zwncxjr9CQk1pSKqCk04Bjx0SGMGaNp75kP4NN7TCyVYV6L0PCHYvmCAgVUSRZW2al7s7SyOBBnAvw9njucN9iAaJxHOZXjHm6Qsz3NOX2Pn1IxBlFdJzQmb9Xw3gss5loFSX3k32tyozcL/kDCMI1guI/G94BfAJmw0wu/ZS2t9FhL7pRBl07scIsXyY/F4NkQl1kWbmgi+48953bMJwuV86VrCarViOf6KxnHu6BxG20IyHBINIjirKJ0WISMPVQuu+7bZV44oPTIzlTzPX0GgXjzfCkt4EKMqdSpqsAaRrbUTJVDO67kVRB+ftLrLN7GYyMoI/V01GOgbzCC3HPsKTJezkjh1A9F42XEcPWxkM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2026 10:11:09.3307 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec5488ba-d1e3-4046-d3c2-08df02912f23 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: DB3PEPF0000885A.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9200 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
gdb: introduce file_reader_t to read procfs files
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gdb_build--master-arm | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | fail | Patch failed to apply |
Commit Message
Matthieu Longo
Aug. 25, 2026, 10:09 a.m. UTC
The previous implementation of linux_find_memory_regions_full could
still return success even when none of the /proc/PID/[s]maps files
existed, or all reads returned 0 bytes (this last case can happen on
Linux when the thread-group leader has exited).
As a result, the function could incorrectly succeed, allowing core
dump generation via the gcore command.
This logical defect was allowing, by chance, the function to return
success and hence, allowing fortuitously the coredump generation via
gcore command (see gcore-stale-thread test for more details).
A previous patch in this patch series fixed this issue by using the
first LWP ID of the current inferior instead of relying on the PID.
This patch adapts the code to use file_reader_t and makes the function
return an error if reading any of the procfs files fails.
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
---
gdb/linux-tdep.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
Comments
Matthieu Longo <matthieu.longo@arm.com> writes: > The previous implementation of linux_find_memory_regions_full could > still return success even when none of the /proc/PID/[s]maps files > existed, or all reads returned 0 bytes (this last case can happen on > Linux when the thread-group leader has exited). > As a result, the function could incorrectly succeed, allowing core > dump generation via the gcore command. > This logical defect was allowing, by chance, the function to return > success and hence, allowing fortuitously the coredump generation via > gcore command (see gcore-stale-thread test for more details). > > A previous patch in this patch series fixed this issue by using the > first LWP ID of the current inferior instead of relying on the PID. > This patch adapts the code to use file_reader_t and makes the function > return an error if reading any of the procfs files fails. This commit message seems out of date. As far as I can tell the issue you are describing here isn't fixed yet. Further, I took a look at gdb.threads/gcore-stale-thread.exp and couldn't find any text talking about this issue, so saying "see gcore-stale-thread test for more details" isn't super helpful. It doesn't sound like this patch was actually aiming to fix the bug you described anyway, just to convert to the file_reader_t class, so honestly, I'd just drop all discussion of the previously fixed bug. But if this patch is fixing the bug then I'd expect either a new test to be added, or if gcore-stale-thread.exp does hit this bug, I would have expected the test to be updated now that the bug is fixed. Thanks, Andrew > > Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org> > --- > gdb/linux-tdep.c | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index e2c5b2d8815..2833d8a4bb6 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -1828,24 +1828,22 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, > } > } > > - std::string maps_filename = string_printf ("/proc/%ld/smaps", ptid.lwp ()); > - > - gdb::unique_xmalloc_ptr<char> data > - = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); > + std::vector<smaps_data> smaps; > > - if (data == NULL) > + file_reader_t<char> smaps_freader > + (string_printf ("/proc/%ld/smaps", ptid.lwp ())); > + if (smaps_freader) > + smaps = parse_smaps_data (smaps_freader); > + else > { > /* Older Linux kernels did not support /proc/PID/smaps. */ > - maps_filename = string_printf ("/proc/%ld/maps", ptid.lwp ()); > - data = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); > - > - if (data == nullptr) > + file_reader_t<char> maps_freader > + (string_printf ("/proc/%ld/maps", ptid.lwp ())); > + if (!maps_freader) > return false; > + smaps = parse_smaps_data (maps_freader); > } > > - /* Parse the contents of smaps into a vector. */ > - std::vector<smaps_data> smaps = parse_smaps_data (data.get (), maps_filename); > - > for (const smaps_data &map: smaps) > { > /* Invoke the callback function to create the corefile segment. */ > -- > 2.55.0
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index e2c5b2d8815..2833d8a4bb6 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1828,24 +1828,22 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, } } - std::string maps_filename = string_printf ("/proc/%ld/smaps", ptid.lwp ()); - - gdb::unique_xmalloc_ptr<char> data - = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); + std::vector<smaps_data> smaps; - if (data == NULL) + file_reader_t<char> smaps_freader + (string_printf ("/proc/%ld/smaps", ptid.lwp ())); + if (smaps_freader) + smaps = parse_smaps_data (smaps_freader); + else { /* Older Linux kernels did not support /proc/PID/smaps. */ - maps_filename = string_printf ("/proc/%ld/maps", ptid.lwp ()); - data = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); - - if (data == nullptr) + file_reader_t<char> maps_freader + (string_printf ("/proc/%ld/maps", ptid.lwp ())); + if (!maps_freader) return false; + smaps = parse_smaps_data (maps_freader); } - /* Parse the contents of smaps into a vector. */ - std::vector<smaps_data> smaps = parse_smaps_data (data.get (), maps_filename); - for (const smaps_data &map: smaps) { /* Invoke the callback function to create the corefile segment. */