From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kfljHMEgTWqkLisAWB0awg (envelope-from ) for ; Tue, 07 Jul 2026 11:52:33 -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=ZTcVkxUx; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZTcVkxUx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6EBD51E098; Tue, 07 Jul 2026 11:52:33 -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 D3DA11E024 for ; Tue, 07 Jul 2026 11:52:32 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C66354BA23FF for ; Tue, 7 Jul 2026 15:52:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C66354BA23FF 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=ZTcVkxUx; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZTcVkxUx Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::1]) by sourceware.org (Postfix) with ESMTPS id CF8AF4BA23F0 for ; Tue, 7 Jul 2026 15:51:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF8AF4BA23F0 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 CF8AF4BA23F0 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::1 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1783439490; cv=pass; b=ebRDIRQbuU34BHwk1YjuVzA8hRZkk6Z8bsMp/tUGkr0dGrra49XhUj6cUKvJb+uLh1C6bXCnrQzODqtSYDzBvbbQjZeosv8HYUclpZ29r241Xg59eMUlzzgYaPxertj+ZW5Bppp615OZPksc6Bixb1UzouhYU3HEtbY9+VzWx2M= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1783439490; c=relaxed/simple; bh=hyTDfU/zKos9TezIT0knv1atHOB2i5ABmHMIFq7l8rk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=d9dhfJjuCawNzt7j3rqpOg4GKLPWMsGVhtMTVzBW23iYqi9HCDV1CniXFlx41ZgoEl2+c8D8J/Y2QKpLc1EgZeeyeyilFW7UOpTSpbv0RkHMwL1lq7U4/qh0oVBJfnf8+JPFo0yzeosx2ACxq5FpkVaLo3F7yAffdf0ua2Vjmas= 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=ZTcVkxUx; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZTcVkxUx DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF8AF4BA23F0 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=j6jvAOrsdVm9bUbgHueyFmmtxf4U6Lu0TmeiZS+Ln0WJwZ5qEdA8nYWQKiQkSc1FeayTbuZ+Y+wPmNApClnG8ZdutEaF+gXnu+kJg3ifjAHwZqGxuUwuHLSmu6znQ1FN9tShaj+itygsRLCKWHgEvZ16QZb0z+aZtlR5eDtlLt4T5x/uC/waf4bf4hi3I0j2t3mc3vHkUW5tRcaDaFFolhNUnPHOQuuKefFOFhOr+bQXuLWXlkcAbzTIbO8HOZmWynn6tM0lC+L21UZebPQoqvnsJRgdcOrszlhCxPxu9STijd5P3UUA45mPk4iB+aOizHtWDrpAB1dbw0wWKq9kfA== 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=wl+Xnc/rHonrX5XwatZyVxYR+r414/jWQ0rh0C1Dm/w=; b=gd06tkQNhM1h/nQLstnS93MwTaEgA4653ICZcJ4xTokurRp53gnrNPv71zBdDZ+LLIKU494FQ012/F7Arc+xzD7KJ+hZWHoH9MYE72spxCjnuxgLAtw8BDBNoG5SZAOJKBgXjXwOJI0AKxugENMteXDCG8GBpuq8GJnBm0Khfomy+aVjZVnqSqwoDHi9wbAKX5yKmh2rP1VaQsozxrkRV6b1YbaGWFdcArb355+A65BcG3trJAsjFNhaG3qzXA721eH/BENNDlln2eLYOh/kRmk5MlD0L2pWdNCfPAp8mj3gYHaQSra7WNrEzu8JngjjF4ba6hKyV+zxQ26PEWvKTw== 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=wl+Xnc/rHonrX5XwatZyVxYR+r414/jWQ0rh0C1Dm/w=; b=ZTcVkxUxKYU+GlgckSsnsJVNgVFpSDTnjZEBaqb0a84vRTDQaR/vkrceUlPXPTAbCnIEaEbTd9OMT2UdXYXB+6ua8nE0qbq8Epio3Eh+tbi5MIybbeaMiWpSf9ik5GWbp38eX6MfX33fy5fghX2e5Tr4jGZxIP/4cUMd+cN5wu8= Received: from DUZPR01CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::18) by PAWPR08MB11510.eurprd08.prod.outlook.com (2603:10a6:102:50d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul 2026 15:51:25 +0000 Received: from DB1PEPF000509F6.eurprd02.prod.outlook.com (2603:10a6:10:3c3:cafe::4e) by DUZPR01CA0015.outlook.office365.com (2603:10a6:10:3c3::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.13 via Frontend Transport; Tue, 7 Jul 2026 15:51:25 +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 DB1PEPF000509F6.mail.protection.outlook.com (10.167.242.152) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Tue, 7 Jul 2026 15:51:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NtPX26B4W2qmw3w7YU18T+nYsYkbtfo4jH0X6skGEW9sx0KvHJBIIo61QT/IrlAfjI5/Nsg6c9LMfHhyJimnCsLmG9aclK/zq0DnQZTOB/ZilxKFoFiY73+COdprb0QdUonBmsC2XwY73nDt84KlO/R1BXXDAPaWGHDpsU43kkk+uNyaNG6yc+qdIgKISCPVWqofhMrypML4dwRVS76uozO2FueTj/PMFMJEuhZCM/kiDDjFHM6XeBQGidi9+ZqEtF13WoDyujRGzy0n4aT0pV2/mOye24k41zrBqwBj08zpGnf8aKaE0akOiqiKCBiV1cc+gAhRCet9ZMUbSiZAcg== 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=wl+Xnc/rHonrX5XwatZyVxYR+r414/jWQ0rh0C1Dm/w=; b=RysEt+r3jPpa1mhGC3PvY2ZCWkhwceQp1f+duPxXXVH9AvpHy4Yc2DcDZPMcn+XDSNG0hYaBbET31d8NsSuD0B4iffgnRJa78OULqRFwEenU40On/DIyAnEO00fRjCKtMwWvYxbyL1H4JJXKaIiYYv7JPYUL5DF/yUb2Zo+MzrgS6HgRgxvuhhMdrk6NhX3QkS/bZAs6W7EvttzePk8Sgb8xJj0e1qRVmx454NFMOnkn/WZpfAUIJKVe5czmuJJTm0aMZdQ9TywcC42FsnrAo+FQxJFyXOWXGTNL0YLGoGTiORyM5aaCP5SHLeyfAVP2mn9ZULJKBpr7D24c76cOKg== 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=wl+Xnc/rHonrX5XwatZyVxYR+r414/jWQ0rh0C1Dm/w=; b=ZTcVkxUxKYU+GlgckSsnsJVNgVFpSDTnjZEBaqb0a84vRTDQaR/vkrceUlPXPTAbCnIEaEbTd9OMT2UdXYXB+6ua8nE0qbq8Epio3Eh+tbi5MIybbeaMiWpSf9ik5GWbp38eX6MfX33fy5fghX2e5Tr4jGZxIP/4cUMd+cN5wu8= Received: from AS4PR10CA0009.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::12) by MIYPR08MB11945.eurprd08.prod.outlook.com (2603:10a6:290:7a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Tue, 7 Jul 2026 15:50:22 +0000 Received: from AM1PEPF000252DD.eurprd07.prod.outlook.com (2603:10a6:20b:5dc:cafe::8) by AS4PR10CA0009.outlook.office365.com (2603:10a6:20b:5dc::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.9 via Frontend Transport; Tue, 7 Jul 2026 15:50:22 +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 AM1PEPF000252DD.mail.protection.outlook.com (10.167.16.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Tue, 7 Jul 2026 15:50:22 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 7 Jul 2026 15:50:21 +0000 Received: from PF4S4363.arm.com (10.57.40.47) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Tue, 7 Jul 2026 15:50:20 +0000 From: Matthieu Longo To: CC: Luis Machado , Luis Machado , Andrew Burgess , "Yury Khrustalev" , Pedro Alves , "Tom Tromey" , Matthieu Longo Subject: [PATCH v1 07/10] gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t Date: Tue, 7 Jul 2026 16:48:57 +0100 Message-ID: <20260707154900.94542-8-matthieu.longo@arm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260707154900.94542-1-matthieu.longo@arm.com> References: <20260707154900.94542-1-matthieu.longo@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM1PEPF000252DD:EE_|MIYPR08MB11945:EE_|DB1PEPF000509F6:EE_|PAWPR08MB11510:EE_ X-MS-Office365-Filtering-Correlation-Id: f22a3e7d-380b-49bd-8cba-08dedc3f9970 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|36860700016|23010399003|376014|82310400026|6133799003|5023799004|11063799006|56012099006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info-Original: RbWmY2dkuRYh24gKSZHJKcp7jLGQMS0m3F0OU+eWyeV3//jlSYVr4BdNhFgdHYOuHp9XDtpWlJ1ANP5PoxT+4w1Kb5eoMWFwGPhmcQxEyMHqERnDLYLenwY2U/UleukkcdsmIzghEosn96ScDFHVyclgizomTb4wfOZoo3R5/wQ/wNkXgQlt9kI5ZkCzkB/tlyWwwQ2JcK2p6P2p4anNmSaljPuA7PBgD+on71pv2BfUAAr38GEVvM31I52lY3Nhf9QA1pUcyMADJDhRPIP498xqVvGFoAzo7b7eFIFDnr+lviCqG9XtJ8sZZyiOqvLwdW0D8jKemKPyQZWQpmBcwqV0Rk8Dafc7QK/oUveG8yXQhbDpyp+WTXE3Vco6LFP2LiDkX/C3mLcWIEOoNWAJAPz6Iq5CxPWLMEU7ytRpDywKmFxCqOHhzxYRGrOh5rHcdc9MF+G+Bj73YiqiIQgI6pTkoG9vLJD9BGy/A8GfNuBC5GJghoChe/+tBEWKT6bQ6vWI4YHaWb390XbP2pu/oGjh07rHNZb3vsHbx6N7V7MRzeZTbdlMqPR6UtVqW0pNuoqzis3onHfsdYeZQY7HYD4b1OxrDvcrsF6YWPURxZBBWsFu48DJx/QnC/yFf7kF0Vc3peQW+SiaAIGfzJnWjZYBn8VqINyzOFVmc4GJXlt6sTc7Qn0AJTXBuD5QLs/EUlNj2BgWui7jFc0sf94D5w== 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)(1800799024)(36860700016)(23010399003)(376014)(82310400026)(6133799003)(5023799004)(11063799006)(56012099006)(18002099003)(22082099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: mNMTpb/4YRjmAZxaeiPMmBhfsyV2+eUxn4wc4FtI0/s2DaxaBfffaghNHSKyKa3qxqAHbK2HXzod679hcfs6ls8fylfPcPamwsD3cXys1kxuQx00fd9nipXH75AhREDm9/XGrStOQPeDmxOzf01BpnRyXihE71yXUAAgEbAmcC4egTQjacf0NYXjvibSHCcBT0J/6E7tW4qiEj6wV4O9iVYkyjSAeBLv575j4PIv+OJmJf/zlVVSIhJfYt0UAJqDF6ps5B2t89Yk/gipTn99xiZcwfituvFPMdUbbBfdIAlY7LeE/TvvYIiM5WyCcNM7fVQx2OUYP8XdmBgnjzqYgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MIYPR08MB11945 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509F6.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 55a43725-7e7b-40c5-70b1-08dedc3f7400 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700016|14060799003|35042699022|30052699003|82310400026|23010399003|22082099003|18002099003|5023799004|56012099006|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: nKbonuUVv1tPsP3elFbkKDxLZ8tp9+CfxdvIdeWFTY+iHi2jKRX6pN2hCOJNITCkKZsrkRiUxYMZDBFti9xdDSGEg/V4Lx4QFPLALlW19bvQ34xU4cCyBWyPhz2JSkgt7k0QXH0ndD7+2h3NOqzVwdisKlexXEPylfr3Y1OTjCyBVR7Y8S13AXV6zdXPiW04iXYzusotviQDqbTJlMZq/drTzRVVnywEQxrv2529zKqu9kvOCE5O5+ESq287sgr6dM1hWuf39BuMMEdkkaBn5+0CDXvBPwTqwhtach3FwfOMKzSK6kVqze5fz3SQN+zvDREo0gyGPBhQfLgXdk/1cAT9kcX0Eu4LZdxopQOXd0ORfYcya1OgwDuPx0J5OsP26tgErdrLsYqdban4Bf7htZrOefkhIygPL/rE1DrvDDNKsn4CPVOxA7SkTG2b9DlB0ydhpomhy1vGV3us0Oh3enJt2smH9WuTuPp988wiEFctL/VAbZ7h6YkzMWA3qt7XUXRcJWPVWUYT7zTDr3+JpTjdNkNCZjxree8kw8m22F4Tfsz7eLPNFGjOFoPrrG2l0NZdpbz8DhxI184sHL21Vs9UsBLGOMBH1ZYYGsyuDFNZFuTP9bS/1djcpZC56SUMTXcJctFceCsF3t3cQDu1rUjq/7y5fvgPFspQyb5UjNM2jTfEOe52BXsIb0PsDmK5mcw3M7usySouKr6AcIUKOA== 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)(1800799024)(376014)(36860700016)(14060799003)(35042699022)(30052699003)(82310400026)(23010399003)(22082099003)(18002099003)(5023799004)(56012099006)(11063799006)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hvMFJtFqKmkOZYynpU5RTRASEajkL7aez48YfNINhSL1bvZdlw6Qi+2XMFfLFcHt702CnxXCyIh41ta60tenDbUQLyupMPRKgHL02Qj4QkyaEFUfK8/b6cxPlc4DIREu4wtO7WttZCibseNqcGow14O1TvbQMvDDtbGVuW38zgozOQylkQeFOqTP28N0wYXgMNrkebXc9H1Y8TB/SHNAVIM8HuvpxWShm1Zt28kNhDsm2YYuYtTrdaqUPMG+CbHM1fBoWMTo5bDJokm0MaenugvszZbVBefzzs/dQn14nXmd/Aefy/ohvrTPIT/ytFqgg0faQE7Xu0hub7rlum8c+NyAu2lCxn8uuNdv/yfxJPdiRfhPL8VL8dolDK76B+U5AREbwLn7VgrSQ374KM0ZHuEGS0APQv8LDHVsbqPB5xzGSsItYWtucKIwGtenaQZe X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 15:51:24.7545 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f22a3e7d-380b-49bd-8cba-08dedc3f9970 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: DB1PEPF000509F6.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB11510 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 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 codedump 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 is reading any of the procfs files fails. --- gdb/linux-tdep.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index a2af1586d35..f1cea3040f9 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1777,25 +1777,22 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, } } - std::string maps_filename = string_printf ("/proc/%ld/smaps", ptid.lwp ()); - - gdb::unique_xmalloc_ptr data - = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); + std::vector smaps; - if (data == NULL) + file_reader_t 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 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 - = parse_smaps_data (data.get (), maps_filename); - for (const struct smaps_data &map : smaps) { /* Invoke the callback function to create the corefile segment. */ -- 2.55.0