From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tQ90B/B1Z2pISzAAWB0awg (envelope-from ) for ; Mon, 27 Jul 2026 11:14:56 -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=j2WHoDhG; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=j2WHoDhG; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 082381E09E; Mon, 27 Jul 2026 11:14:56 -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 73AC21E099 for ; Mon, 27 Jul 2026 11:14:54 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 006AD4BA903F for ; Mon, 27 Jul 2026 15:14:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 006AD4BA903F 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=j2WHoDhG; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=j2WHoDhG Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11010036.outbound.protection.outlook.com [52.101.84.36]) by sourceware.org (Postfix) with ESMTPS id 2BDE14BA903F for ; Mon, 27 Jul 2026 15:14:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BDE14BA903F 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 2BDE14BA903F Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.84.36 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785165264; cv=pass; b=UdOCm4mtwXbFi5kegvYsR7tYn0OmmdO5L9RqxuOsb1/TE7E71ae/LL8mU2cq8uHjPcmaWhfoB1HSt7fWP2ww0TeYtC0haPQHpXCe3tSXJVCyIw1wo9xRZ4C/rSA0fT3hK8rE+V14jjOWT0ZTa58woBr19uhCPTxP4AhOUKllJB4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785165264; c=relaxed/simple; bh=7Qi5uXYDL57jtO70jTGLDxEle0VEYohfMqJ/tx4mjeQ=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=KqRPcIWg9UBq1ki79B9uyHfchiBvXJ09zhqEfrZfes6gwNL+xm2u7gSKb+6enrE7OMSG1JJRcVVDROaUj+CMXsqIX4qjpHvX/6EgyCDhU0U4NhkyNpUZbyVYdZBrCJBvs6HykRNWPyFk6ml5cI1BNjLQRmQ+aqAOkhvInP8EMyQ= 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=j2WHoDhG; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=j2WHoDhG DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BDE14BA903F ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=mCgv/yrqrFz/dJjWp/d6RqW9wMSsLbpwRqfQ3tMZnbXhW0j4GlDlim31xfbvnm44ZWH5Y49zIr8AaNCpHUvA9+ySRgK5vvXgEms/w413+of1Zy83bIykTjYObGfOmN1N78ZP0IUSkln3D+BjiyBLem5NVfc3q8f5rB3KF9WmsA3TlJL3UHOoyOaRBhnjlQa8Qcho87GMuv/yxp8w6dmNT/t/yHLrpZl7xSTXF23y2qdW+N7x6PQQuhQVh3svmX+LA4FyM7CZkA+YxkgWY9jvbCf1EsZzu9g6vQv9GwESF2fzsQoFG/rpLV0KnFEZTaok/niWXQjzLOxpQQUVt+rwKQ== 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=Wo3rjwaPXpmZcgyHlkivzWtZ6x+BOacvTHNhO/TICOY=; b=HdPkxx6a7O+XNkKivq+pQKdQGoM7sZZutWuf5TNivACPbQyPuB8KSvEFjr949q04Q8/1cVxuOxT3N5mlytJJ5M1d6Iy0QQMfE2Sikvvaes7OS+0CXOohDHho76jWlOZYJjRZi+RvfJhCZRnl/CM15TxeR2DzB1MjAZFHnYGP2b83Da8R8X5WlW2AhNbGmyshI7qwBpoPLs0g6bZWIW4Wbc2wbo0i9M15pSeFyUyhVvdNdhekZONlrvT8vnOIQlF/6Y4Lr7GP99NulsvZgs+YhKXcnbDgl7lnLTBMRetkaz1w1SpGtIifoYCJ4SNgQuzfl5Tv9dOerA67h1lnueIq0w== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=intel.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wo3rjwaPXpmZcgyHlkivzWtZ6x+BOacvTHNhO/TICOY=; b=j2WHoDhGj8uRA2KYw/L2aajLbGGdyWwlMv1Gq3bP53ZyfrFfQnww2K4sinEOacdF7VcgOkiDY8o6ICqsscS07P+vOn5Ngmaa2yBZdGt2l1RSKOuT+cG1vC3Q49F0rzHU9gMflESazN4kjQyrbgazKEC8Cq/9J8v6/GuP3NI+kls= Received: from AS4P189CA0042.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::20) by VE1PR08MB5614.eurprd08.prod.outlook.com (2603:10a6:800:1a8::16) 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 15:14:17 +0000 Received: from DB5PEPF00014B89.eurprd02.prod.outlook.com (2603:10a6:20b:5dd:cafe::59) by AS4P189CA0042.outlook.office365.com (2603:10a6:20b:5dd::20) 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 15:14:17 +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 DB5PEPF00014B89.mail.protection.outlook.com (10.167.8.197) 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 15:14:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iLYVhbvrH8GlHSI5JJ3ReFlBrCwDU3RBAUCp+R5dXoLm4MBgFdOF7CdlX7ouGrsU0TVEAhoW9UeNOhPe40oQhZAD/xGzokew7vOylwSKL7L+aIw+LHeEo+C+W9sZJ1vsO3hG9VSg/MJnBTQz3JkcW4y8UpHU4XZXbh/iuqzoQEkw9O+pWdMuhsyO7Vtonr6wy2i5M/4q4DhXECN/5kleSUJELervoWn5cjZOAzE/SWOE+ulejzD2Yb4pBcWQd9g5lG88Hh5YwYB/iqwqjJCkz3ZoQHQr5TJNmZbyIW/gYgFSKJmCLi+bpNtF+OcTXfbNVRSEjHvXMt7jVwWqw3VT8Q== 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=Wo3rjwaPXpmZcgyHlkivzWtZ6x+BOacvTHNhO/TICOY=; b=tvZVg8PAv4FgYbWK5Zp/l97TF7JfTTuAnbscOe3qU9i67ON8BNSNtW/3O4/1cOgdcV2pJc+UrPLuS5hV5P/bDoW0sVhDzcBnW2eKXxL9M0eFL08c1ZfGDpwls+TmD3DMr5DMJcMACXsX05DSgcavAKeu4x8Gp9Al6f0fRxnhS70+MaOZ3Z1AMhukaLlZBqPaug7n9XcVePcH3osgVayptf2qqjz8lTPpFdKwZWiv+/Tu2GUyzgfrcuPnGmRRGT/lJzGqjhtIZc2u5D3axTpwwOHpErvQjY3AxN+VmOncpNCvsl37oFVJM56LmK4MKF/pdp9eo023bCp9AxYJdIFpWw== 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=Wo3rjwaPXpmZcgyHlkivzWtZ6x+BOacvTHNhO/TICOY=; b=j2WHoDhGj8uRA2KYw/L2aajLbGGdyWwlMv1Gq3bP53ZyfrFfQnww2K4sinEOacdF7VcgOkiDY8o6ICqsscS07P+vOn5Ngmaa2yBZdGt2l1RSKOuT+cG1vC3Q49F0rzHU9gMflESazN4kjQyrbgazKEC8Cq/9J8v6/GuP3NI+kls= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB8659.eurprd08.prod.outlook.com (2603:10a6:20b:563::10) by DB5PR08MB9998.eurprd08.prod.outlook.com (2603:10a6:10:489::6) 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 15:13:14 +0000 Received: from AS8PR08MB8659.eurprd08.prod.outlook.com ([fe80::96bf:2de3:5eab:70ae]) by AS8PR08MB8659.eurprd08.prod.outlook.com ([fe80::96bf:2de3:5eab:70ae%5]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026 15:13:13 +0000 Message-ID: <856a4adb-d6b2-4516-ba8e-54419a6ee247@arm.com> Date: Mon, 27 Jul 2026 16:13:10 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 05/10] gdb: introduce helper class file_reader_t To: "Joos, Christina" , "gdb-patches@sourceware.org" References: <20260707154900.94542-1-matthieu.longo@arm.com> <20260707154900.94542-6-matthieu.longo@arm.com> <7cac4b13-581f-4b3c-b42f-65f47848e800@arm.com> Content-Language: en-US From: Matthieu Longo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0189.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::14) To AS8PR08MB8659.eurprd08.prod.outlook.com (2603:10a6:20b:563::10) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB8659:EE_|DB5PR08MB9998:EE_|DB5PEPF00014B89:EE_|VE1PR08MB5614:EE_ X-MS-Office365-Filtering-Correlation-Id: a184c25c-5d1a-482d-ac51-08deebf1b9d3 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|6133799003|5023799004|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: EuZZrG6nyTm8XRRZb6A2MfmOQkCkzYoQgYNcXn775pZ3zO9O6COaulhMJYg/6Rd7Al+0jX5t7VLR61K6cfR6uFkUmqLh56WxeFIvjoI31y7sbxctUsoaiLdIbqa4xyPmNRvsC2Fikt8wGYsIMaZZyqEQlXnhKmMiNbH0MUMiOwSGrH42oCcD218I7GsRHL+lDbkIe9VwbQAO/kO1F74EXIuhjVi0cujwzGMEJo4E3JQFf6eCE+PsTU5XXFCN9UZ+qZNDikjgv5fqlguppFEQ8P5awiB2RahCgfScP+pc4aLpqwyioWO4ivVLhrVoM/2+jdLfNmpqNnvZo2bheoTprvxe5b5tfMDRGFGc+RHTjxTyTnOVNT/M1Mc6TQ6BG7pPE4sSD+zGNTZlvF++Zepznqefk6B34a9Av6f5qyDxJfbYLkrf7N4qmifMEYq7tr2ns9oyqWB23wsSh+NW8pAVnlO+KB9jhqmJAP169VkpLujF1QYOoNGZa3wwdKbSx0bnaS8JYwJGT2U3rIu1cUkzuj0ZKaFAnZxdLVS5MumUzcLLcD1e9ikVsc2jhYqp9zUw9lx6M0l1fVp4+uggDFikTIBSWFO0FjKGjDEkYtZvaqfbGhrDWkJ64ypzvRybc8oxf7yoBmtgJTrEvwz9HPgezSjSHWD1TV9FKDBQIi72qLU= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB8659.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(5023799004)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: b/0aXF1Js5erLhQGLYTxE4+WWWV8ftE7fzNq1G107xW0Tquy0cH0YKyY/CL8CeKbX2hySsR4pqW+90t2k0P+wHM86IFh+t0mO70dVYxQWDjuv1/xxYJsz4kd0sMYww8BVANAA361JKf1MgmUc/JyBJmZJ59VVjSOUk9p0Bn5yiEZcAfwdACTK4PdA5LwhJfPcT4o7lp44GlGihu5VxIv3J4jgvqRz4pp5GT20naZY2ACAcUFBBj5kFuNH7Ly5JyF9lKwVfjgWcUGDzAwb6fWnr5esywXWPI7Vkshgv5MCkLqbthuLb3lUiUGipuvQ2HeHPqikNLrvZiteO73PKDjAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB9998 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B89.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c38c7aeb-f535-49c4-7218-08deebf1932f X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|82310400026|376014|1800799024|23010399003|14060799003|35042699022|6133799003|18002099003|22082099003|10067099003|5023799004|11063799006|56012099006|4143699003; X-Microsoft-Antispam-Message-Info: 4RpjvXSZkbQvIBE1TGFLEN07u2S2iYoy3lNC7QAEicD4TBZu+O7G4Tt0kLHjwnAykfFnD2ZFfrAAw36srq1/Y/WUgOXEHa3TxH83wWuGTpSwgOkwTmXMVZC4+OotEhALdR+1Seh73fm+HVPc0m9FuWtk4BinI1XzctGt8r6wwQJDytGRzu1QN12aVS9ZqOM85O6O+preuC3DpoKYWRy6wc5DQSBMqtWPiyEl5JiD7Gmy57R9KixOdci9w78A8/v+QzM73rizglaGpvv8qPjy6y1mQfONElEvL269/deccuciAsiSEpoT7ajzu8NjlZQgpPhWZpWmzAstrwGVV+AZrGiy5h6Oaqom9KuJXWj4orVxvsGMWg0GmSCMLr0cvndxrX0tlfiY/n05o2+zmPNJ4DCxI7VWvFV4KKKbhRiMpShDvR+pjX+fXBE8c2q67T3dkts6xVTz7qpbAr4Emxo80Yq7yaW8yCrppERjyOm5x8y8fIPp65TCBSFUamaeTSDVi+iDVjoyZJxXgPatbLc7sy9U3XG8wAmH3yNjF9vDnihEO4p/HlYtu4EBjE6ICNYm60JeFXJgoHg68l8Fx/NK/+YHUFXmZcFoiflyCDN1vQZQgTEnyw4GydQG9uAPWBuy/fb5Ov1AwWz7QkAch2vkZvq1iwAO1Bqf1mgdnz+0GMoMM7KxcA8NQndshji99wE4wQDjCnkyega5q6ODKY5fYA== 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)(36860700016)(82310400026)(376014)(1800799024)(23010399003)(14060799003)(35042699022)(6133799003)(18002099003)(22082099003)(10067099003)(5023799004)(11063799006)(56012099006)(4143699003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E21i+iliQiO+OyM69f4b/g1X6+0UbexKCzYQBEyGh8fHYP6Q1LNH01wH4sM97VCD0/bdEVXlh+VZuakPlSK9Uni6sYD7BCPO9aOOo1MT1s2yyxvCdaeB8MycohxW/WXLdfd0PiLTkCW0JnYCST+GvxWKSuwheVbwXx9jXAGkok2dXWzGJA15SWjQZqfWc5jJojibJbHvGX/VwBVUXg+mdf4OUBnM7FuawCmB7BxV3iwRIHjjpCh2M5ak4d8cvjFtIfBS2Xkaha/AS4nbScJaALNXhcVYtHBB1OBZFfbi9LOrXU2B/1z/R0HRm7w/m23X4AJ48uxIFwyq/9aoDxiv9/j91/7yiMdms8g3ADWzCZFQlVvKCLIpMN5ckR31YHjEQCf7ytPvf0qN2oQvA9KdvpeHmbMav8ZfBIDtVxo24XoI5ybW/loTD7/kNQ2CLuI/ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:14:16.9834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a184c25c-5d1a-482d-ac51-08deebf1b9d3 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: DB5PEPF00014B89.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5614 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 22/07/2026 17:36, Joos, Christina wrote: >> -----Original Message----- >> From: Matthieu Longo >> Sent: Montag, 13. Juli 2026 19:13 >> To: Schimpe, Christina ; gdb- >> patches@sourceware.org >> Cc: Luis Machado ; Luis Machado >> ; Andrew Burgess ; >> Yury Khrustalev ; Pedro Alves >> ; Tom Tromey ; Kevin Buettner >> ; Thiago Jung Bauermann >> >> Subject: Re: [PATCH v1 05/10] gdb: introduce helper class file_reader_t >> >> On 13/07/2026 16:50, Schimpe, Christina wrote: >>>> @@ -2802,9 +2790,6 @@ linux_gdb_signal_to_target (struct gdbarch >>>> *gdbarch, static bool linux_vsyscall_range_raw (struct gdbarch >>>> *gdbarch, struct mem_range *range) { >>>> - char filename[100]; >>>> - long pid; >>>> - >>>> if (target_auxv_search (AT_SYSINFO_EHDR, &range->start) <= 0) >>>> return false; >>>> >>>> @@ -2842,7 +2827,7 @@ linux_vsyscall_range_raw (struct gdbarch >>>> *gdbarch, struct mem_range *range) >>>> if (current_inferior ()->fake_pid_p) >>>> return false; >>>> >>>> - pid = current_inferior ()->pid; >>>> + long pid = current_inferior ()->pid; >>>> >>>> /* Note that reading /proc/PID/task/PID/maps (1) is much faster than >>>> reading /proc/PID/maps (2). The later identifies thread stacks >>>> @@ - >>>> 2852,15 +2837,14 @@ linux_vsyscall_range_raw (struct gdbarch >>>> *gdbarch, struct mem_range *range) >>>> a few thousand threads, (1) takes a few milliseconds, while (2) >>>> takes several seconds. Also note that "smaps", what we read for >>>> determining core dump mappings, is even slower than "maps". */ >>>> - xsnprintf (filename, sizeof filename, "/proc/%ld/task/%ld/maps", >>>> pid, pid); >>>> - gdb::unique_xmalloc_ptr data >>>> - = target_fileio_read_stralloc (NULL, filename); >>>> - if (data != NULL) >>>> + file_reader_t task_maps_freader >>>> + (string_printf ("/proc/%ld/task/%ld/maps", pid, pid)); if >>>> + (task_maps_freader) >>>> { >>>> char *line; >>>> char *saveptr = NULL; >>>> >>>> - for (line = strtok_r (data.get (), "\n", &saveptr); >>>> + for (line = strtok_r (task_maps_freader.data (), "\n", >>>> + &saveptr); >>>> line != NULL; >>>> line = strtok_r (NULL, "\n", &saveptr)) >>>> { >>>> @@ -2879,7 +2863,8 @@ linux_vsyscall_range_raw (struct gdbarch >>>> *gdbarch, struct mem_range *range) >>>> } >>>> } >>>> else >>>> - warning (_("unable to open /proc file '%s'"), filename); >>>> + warning (_("unable to open /proc file '%s'"), >>>> + task_maps_freader.c_filepath ()); >>> >>> IIUC, before your change, if the file was empty, we did not show a >>> warning, since target_fileio_read_stralloc handles the case like this: >>> "Empty objects are returned as allocated but empty strings." >>> >>> Based on your file_reader_t implementation, I think we get here in >>> case we can open the file but the file is empty. Not sure if in that >>> case the file can be empty at all, but it is a behavioural change that should >> be avoided in my opinion. >>> There are further similar cases in this patch. >> >> An empty file is normally fine, but in most of cases, pretty useless hence the >> proposed change in behavior. >> >> However, I can see a reason when a file is empty and a process still alive. >> From man 5 proc_pid_cmdline: >> > This read-only file holds the complete command line for the process, >> unless the >> > process is a zombie. In the latter case, there is nothing in this file: that is, >> > a read on this file will return 0 characters. >> > ... >> > If, after an execve(2), the process modifies its argv strings, those changes >> will >> > show up here. >> > ... >> > Furthermore, a process may change the memory location that this file >> refers via >> > prctl(2) operations such as PR_SET_MM_ARG_START. >> >> The last sentence suggests that an empty file is still valid, and can have a >> different cause than a deceased process. There might be others similar cases. >> >> I will change the behavior back to what it was for empty files. >> >>> Would it make sense to change the file_reader_t bool operator to >>> return true in case the file is empty? Maybe we could then additionally >> introduce a new method bool empty (). >>> >> >> Yes, it would make sense to add a new method empty() and even error (). >> I will also change the behavior of target_fileio_read_stralloc in case of errors >> (see comment from Kevin Buettner). >> >> bool empty () const >> { m_data != nullptr && m_size > 0; } >> >> bool error () const >> { m_data == nullptr && m_size == -1; } >> >> And bool operator() could be the combination of both: >> >> bool operator () const >> { return !(error () ||empty ()); } >> >>>> +/* Helper class for reading a file. */ template class >>>> +file_reader_t { >>>> + /* The filepath of the file being read. */ >>>> + std::string m_filepath; >>>> + /* Smart pointer to the data. */ >>>> + gdb::unique_xmalloc_ptr m_data; >>>> + /* Size of the data. */ >>>> + size_t m_size; >>>> + >>>> +public: >>>> + file_reader_t (const std::string &filepath) >>>> + : m_filepath (filepath) >>>> + , m_size (0) >>>> + { >>>> + if constexpr (std::is_same_v) >>>> + m_data = target_fileio_read_stralloc (nullptr, m_filepath.c_str (), >>>> + &m_size); >>>> + else >>>> + { >>>> + gdb_byte *buf = nullptr; >>>> + m_size = target_fileio_read_alloc (nullptr, m_filepath.c_str (), &buf); >>>> + m_data = gdb::unique_xmalloc_ptr (reinterpret_cast(buf)); >>>> + } >>>> + } >>>> + >>>> + /* Return true if the file was read successfully. */ operator >>>> + bool >>>> + () const noexcept { return m_data != nullptr && m_size > 0; } >>> >>> I think we should make this explicit. >>> >> >> However, making the boolean operator explicit would make it very >> inconvenient. >> I would prefer to avoid this extra verbose: >> >> if (!static_cast(freader)) >> { >> // handle the error or empty >> } > > Hi Matthieu, > > This part I cannot fully follow, but maybe I am missing something. > AFAIK no static_cast is necessary if we make this explicit. > > Example in gdb: > ~~~ > class frame_info_ptr : public intrusive_list_node > { > public: > /* Create a frame_info_ptr from a raw pointer. */ > explicit frame_info_ptr (struct frame_info *ptr); > [...] > > /* This exists for compatibility with pre-existing code that checked > a "frame_info *" like "if (ptr)". */ > explicit operator bool () const > { > return !this->is_null (); > } > ~~~ > > Here the operator is explicit and used in several locations in gdb without cast. > > Kind Regards, > Christina It seems that I have misunderstood the meaning of 'explicit' all those years. I added explicit as you suggested, and it didn't trigger a compilation error. Thanks for pointing this out. Regards, Matthieu