| Message ID | 20260825100912.514232-3-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 1624B4BA79BB for <patchwork@sourceware.org>; Tue, 25 Aug 2026 10:11:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1624B4BA79BB 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=R2TSB9wb; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=R2TSB9wb X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010044.outbound.protection.outlook.com [52.101.69.44]) by sourceware.org (Postfix) with ESMTPS id 9CF6B4BA2E17 for <gdb-patches@sourceware.org>; Tue, 25 Aug 2026 10:10:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9CF6B4BA2E17 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 9CF6B4BA2E17 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.69.44 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1787652625; cv=pass; b=nS+vbKRxqLvs2EscVh/QSUU9+VxgGj1wuLTcuGDjFDK49pVhy2oZrrxLhai1oXE0y47GXzvbzfp6U7dsycXgjE1skS2xZkikAwNG84CAGTJLN/dqgdBBCrdDQUKbfJcjNg+4oyHLUIpNvbzMbmYPUR1azA1hVLaoktHPomoTMPM= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1787652625; c=relaxed/simple; bh=/xHGvQfyjUl+1j5aztyB7fMK9Rz8sbUJBWGK0f24+g0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=fioACeypk//T4nyqulYA4lnsKEaRxh+U0z5Xt+0QFd4Zgl3BtU7TbEUoc1apcExUwTiX7Rzi2piXGjwfJYTxTG1P1AtJzXe4xuQaewvZRujhyzVns2cBnT7EJ3P8WcncvB2Pxc11TFK2hUQkxVLVorV7gxR2/VAc1ignzzXVUCM= 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=R2TSB9wb; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=R2TSB9wb DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CF6B4BA2E17 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=wIqtggtHxvSKTpS9PkGmz9Cytj+dwz2hJEEKsvkg+XQ039SAJNmKE+suLBoFWTffXLKlMNYamU0egBllv//ITPPmYxSqquL9iqqy+brt8piM2e0I+KKRFvUONdLOugxNVO3As5tt1VgrBoJxMQSovgdGwD0R2e43jHApHIak4TOxXY4PJ77R+oHhcsBI3Pvmp5w1eyxVmD18OOibfMMsnjseOl1BvYgb1HSpzY93odecoJvvzmNVVQfCnkgAfPOeZ+PEZqkmThEDF16KYM1wZPY722ZnEdhJCNNR/eTiFV8ASob4+tvsF6wSMd/sNiSSRKZWbUrOa1nAvmuHQWF9Zg== 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=zJiq5+oja20/JYxemxTuMFF+gcGSDo5goKVaz7dTVq4=; b=eNOpAtiM1RlDDmrf98DijIg531+ADfpq1jlbLBqrm10u1WpJKQPyxN6gcUPUKI0agIL4LqZD0KElspgaauRFr1j3L6+2qnD3nBUYds0bi+rvPU64XiOik3OAkzoJ3aDahZTDixxGzB17Zel3GAWcSq2tWipTaN2fpCHDbw8SanK0wEJmsP4Omd9cDxoV1h9F+CuWlWOuUu3c6NDASpbAgD5du8fj7oygb/tyko4i69ji7soxM+fCYnKic/jJHpSns9m1WjBRD2SApOF+RsgqBc9YaOF23mG4tPrq8ZU3F/6TMuGUscCsI/e1Ks4lenL8y6TcEp0/8PxU/P8diMEm1Q== 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=zJiq5+oja20/JYxemxTuMFF+gcGSDo5goKVaz7dTVq4=; b=R2TSB9wbpOM7ManZePjiESgLP1nujfTVLidgeSNIzljOz9Ydj5kDCl1COQ/G5Qa8PxzxPK+qQSjUP2Vl0PvsnXVHqgUMHGDqyLCJGlptk3TjYhnpWFOdiZp7mpv+kWGHepHEGEoKgGftS/9jtcCkBQYIVU3dUOnlIvF/X1cLlGU= Received: from AS4P189CA0001.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::6) by AS2PR08MB10294.eurprd08.prod.outlook.com (2603:10a6:20b:643::8) 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:13 +0000 Received: from AMS1EPF0000004E.eurprd04.prod.outlook.com (2603:10a6:20b:5d7:cafe::ab) by AS4P189CA0001.outlook.office365.com (2603:10a6:20b:5d7::6) 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:13 +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 AMS1EPF0000004E.mail.protection.outlook.com (10.167.16.139) 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:10:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iRzHwQSIEjoZ1s/70cq4xb+xi6+9r2g3t8+EkqmGj/XIKOaRDmrg8CSoeK/qjWzgAxtjXltKyXbtcu2zukwwmuOeMQell2whnCpSiGmgz0gexpoc3TtztvPj9+fAxzMqpbsrLkYetHHVEhSeUPX3uZYCAknyoRegHwYjBVso1I8uya3JAoiFg3mS10srQsvG18mWwBCGAapV8W3mNVWAyXjYVv2HobraUzPLsKblRyA0aIuNe291wzPWRrJU0shQAQ3PaQUrvvS6Aje3RtR4siJVE09TzoT2JncvcsfnT9ynhYF9l6oVSRzZUYDBl3pGOnzhmNiDibimpk5VuqdV0g== 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=zJiq5+oja20/JYxemxTuMFF+gcGSDo5goKVaz7dTVq4=; b=PWM65Y0rsV7HuCKEUt4cfCqOjQGlJJaQxzKzbRg0fUPl9SwIwRuuDeAyNelvieF1NejFR9uBKyq54vxp1oNwvdyZFLyGSSdhT7SIauS0WXtWssFk8ka4vBliEbqwaWZQXFCQ4Hn94MhLZTH+kcYTgCxjfAQHKidKZoxyZpX56pj1ydUoi+RmZC6t5+LTgy3qdBS7N3AgWPylaX2WjAliu6SPTe2jXp8acrTCpKjg8qpezUn0t/nEfUOKpzIF5MYix23yvMAqr7t2n4sL15+VfpEeF2XVw7JBbi0btbh0LIPngmYzklRCh9n57MZuqszHwfWmEQ2YDgSWJVY5U+g7Vw== 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=zJiq5+oja20/JYxemxTuMFF+gcGSDo5goKVaz7dTVq4=; b=R2TSB9wbpOM7ManZePjiESgLP1nujfTVLidgeSNIzljOz9Ydj5kDCl1COQ/G5Qa8PxzxPK+qQSjUP2Vl0PvsnXVHqgUMHGDqyLCJGlptk3TjYhnpWFOdiZp7mpv+kWGHepHEGEoKgGftS/9jtcCkBQYIVU3dUOnlIvF/X1cLlGU= Received: from VIUP296CA0123.AUTP296.PROD.OUTLOOK.COM (2603:10a6:800:350::15) by GVXPR08MB10861.eurprd08.prod.outlook.com (2603:10a6:150:154::18) 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:09:38 +0000 Received: from MI3PEPF00008492.eurprd03.prod.outlook.com (2603:10a6:800:350:cafe::af) by VIUP296CA0123.outlook.office365.com (2603:10a6:800:350::15) 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:09:38 +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 MI3PEPF00008492.mail.protection.outlook.com (10.167.240.153) 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:09:37 +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:09:37 +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:09:37 +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 2/6] gdb support: add gdb::ranges::replace algorithm Date: Tue, 25 Aug 2026 11:09:08 +0100 Message-ID: <20260825100912.514232-3-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: MI3PEPF00008492:EE_|GVXPR08MB10861:EE_|AMS1EPF0000004E:EE_|AS2PR08MB10294:EE_ X-MS-Office365-Filtering-Correlation-Id: 95531041-d9e2-46b5-fc84-08df02910d68 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700016|376014|23010399003|82310400026|1800799024|10067099003|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: N1UL3n+gNhWO9RLGNOKitZ43bSmVBF40aiwpe2p9kBwxl3+8NAPxxaxj1bAnDa8C/22lJkYGcrG3Tejkd+j//wdRY86Xhc4cSn2EegR+6LGpqhh3pINM40upOd7KH3t2jm+HjHP8xMLNPo6jtY6HlhoFE8A5PJe4iVB4y9a4j4tljgxpRDrDHdeXhLpO5bLTdxUmiwcAAxi/gAY9J3uad9jBpn1S990keABI+eLLRmUL9V0NJV8CPJjvxKJ0U9zDtD1AICA/XmnBpgxakpKya1n10D19jTQWf2oPVaNVF8EiJT2KDh6Wa3fhK0JPlUrs3WlCPAAf5NStKum3+zjTzsnM+BuHHw4q6Ri1YVjsQChrOa9IoMrKH5hj5MAaPaHp9N9oLUInFfY1SAxJJRBCU47HFBbjLNl32OAolRBi1I77L0G7xOCa50uMBsOnp91OUvwGi1AVhvAi3+p0moskZvlnX2/2LN6MaHLZpCSFVIlKpVA+cJ08QpAt4xT22oJKn/mkoeM7HEMmuy/Taop32DNFUVJd6i344Pv7pWQMp+rohJhc5wrNDLKe2PE2Wyf0o1F2naD4k2du1QzXiUY511vuKKrwQgSpNef4hPGqFklW+SIiiFDS9dfE+xI1VlDMlRpU6+wq0uyFRlOUiSUpSQ== 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)(36860700016)(376014)(23010399003)(82310400026)(1800799024)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: 1mH4ElWObdwiPpgwVP1047SjlvRf+DkCI696I8w62LC09sCGclb8m6cU7CWufW4gbOx/K60+Z3JzWrLila8dw7XAtPYkcyjyi0cJ7UueZ5pgSINVzqzDc04XpIBIL8klWDeviYOOsFE/CWDtD+dZytN/+GriNEXpMO6XM9zMwcSgExzNR0Ppwec3ZpqE16FFxhH8nA3rWNtKShxYQeTSYVHesSk9EiiQEJ9lff31BP/kT12AdVqpVDll/N82DmdzMp+r5lJA89MfUr4tlbYpv+HoCdl9R483b5Wk9EySnXbyV4uU9p8TE3nzj3kcp6O2XbAecMHaIt/+NuhR8jy+Rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10861 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF0000004E.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: efd65caf-951f-44db-9bae-08df0290f8a0 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|36860700016|376014|23010399003|35042699022|82310400026|1800799024|10067099003|11063799006|56012099006|22082099003|18002099003|13003099007; X-Microsoft-Antispam-Message-Info: Bva+arjQNBfvoI3N3WgHwzOwzlsJ6MHoC2ShYWvIE4BX++JPbNzuznLKNsGfzZihSLODjRQ1ae9HW8eNRrzaHsIYSTbyNTsSe7BWRs/OWnVXJygIIf6wDNazsBhZsOlRegexTUjgO514vAnRUUeJfkwyhMEakXNXij8aUFoIZ8nykwgGyMD0anu2a98yKf28/Sf2vUvgaS3+ec+ZLOZjOq7Xt/F+h5maflSqvEOnQTPXOLxz5V53GrDJwydZFw/5YtBc7gJw5m7YOHnFsSjxy7XNnwWq8qvfzOtzHPcOhEnfXl577wpMHPhic2p1ySORUYFgicuRawoQay/BjUkkdf1UGv/4MoIIv3d3Grc/rHbggUIooN4VqIY8T8RkAi8Uk7pOlLZjdxMvBQ6zoecPEl9RRWZHZGOUutGK/+Lvwpel5FCoaes9VH7pqU/SUfRYF41T8eOzLRJwOZydoRsbPWl3EzAXEUOFQfK7lOgtSWtkh/1mUNmK3NSARcp4QFg3gfRycr6Pxe9PWQakDs4iLWwGnGvLrCpz7fFxYRW9LuvO2IzATVB5l3qeKNsNEZvYUgn7k7BXN6r3I+OIRnSVDuabxuC6z2KJszIoAgprW5a76mQKo0FjYcaHGgsiNIxNhl0ZPrTnz//9Kt719/f+zg== 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)(36860700016)(376014)(23010399003)(35042699022)(82310400026)(1800799024)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0+r1oZ6LBJ3dO7rrz5zFFjZIRDZMqfuElUHJXIuTm6BsH0k3p96HtxcQXNxaBFFFV7//2F2gyF11f2cvvJpFKbXAUeu0+48vgCRJlR19Dzcr4V6TsncWqp1mDllnZ+7V7FNnD+NM4tCgwUfhnrAJn/5RV9Tc0i62qesSuwnN4ykfNcmhxDmQ2pvbeFdKiv7lMrQFHUE7Ym/9Hxt400+Gp/peOGmWLvsq8657gq8NgcOD28NI/0IQ9dkFW7evsFzSxeA3sibdmT63RfdhudLOxj/JyYa9lrsUrL4RWZ8HP6/+uInRtoN6LGnfZOb5jvAXxfIfbGEPdv5Ybr5wZDDtiQDSU5io2Q2xyMQFY6pdo/8B71Tc4+vjLFtWeJ4j++IRTpX4+S8wIdqykUpJmj6+XJHzMHddYmHmOWhbAv0jln2jIo7Fz2qI2BZ79CTmLKfy X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2026 10:10:12.7431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95531041-d9e2-46b5-fc84-08df02910d68 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: AMS1EPF0000004E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10294 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_DNSWL_NONE, 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
Provide a C++17-compatible replacement for the C++20 std::ranges::replace algorithm, allowing callers to use a consistent interface until GDB transitions to C++20. The helper should be removed once the C++ standard library implementation become available. https://en.cppreference.com/cpp/algorithm/ranges/replace --- gdbsupport/array-view.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Comments
Matthieu Longo <matthieu.longo@arm.com> writes: > Provide a C++17-compatible replacement for the C++20 std::ranges::replace > algorithm, allowing callers to use a consistent interface until GDB > transitions to C++20. The helper should be removed once the C++ standard > library implementation become available. > > https://en.cppreference.com/cpp/algorithm/ranges/replace > --- > gdbsupport/array-view.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h > index 8431d7f5add..f9842ecff30 100644 > --- a/gdbsupport/array-view.h > +++ b/gdbsupport/array-view.h > @@ -225,6 +225,22 @@ void copy (gdb::array_view<U> src, gdb::array_view<T> dest) > std::copy_backward (src.begin (), src.end (), dest.end ()); > } > > +namespace ranges { > + > +/* Replace all occurrences of a value in the provided range. > + > + Note: this helper is a reimplementation of std::ranges::replace, only > + available from C++20 onwards, and consequently, should be replaced by > + std::ranges::replace once GDB switches to C++20. */ > + > +template <class Range, typename T> > +void replace (Range r, const T &old_value, const T &new_value) Looking at the linked cppreference page, the C++20 functions take R as 'Range &&r'. Doesn't your versions create a copy of the range? This will work fine for non-owning ranges, like gdb::array_view, but will mean replace operates on a copy of the range for something like std::vector. Even if what you have above is intentional, I think this difference should be highlighted and explained. Also, as this isn't specifically tied to gdb::array_view, I wonder if this would be better put into a new file gdbsupport/ranges.h ? I don't think anything much is needed to create the new file other than just adding the file, so that should be pretty easy to do. Thanks, Andrew
Andrew Burgess <aburgess@redhat.com> writes: > Matthieu Longo <matthieu.longo@arm.com> writes: > >> Provide a C++17-compatible replacement for the C++20 std::ranges::replace >> algorithm, allowing callers to use a consistent interface until GDB >> transitions to C++20. The helper should be removed once the C++ standard >> library implementation become available. >> >> https://en.cppreference.com/cpp/algorithm/ranges/replace >> --- >> gdbsupport/array-view.h | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h >> index 8431d7f5add..f9842ecff30 100644 >> --- a/gdbsupport/array-view.h >> +++ b/gdbsupport/array-view.h >> @@ -225,6 +225,22 @@ void copy (gdb::array_view<U> src, gdb::array_view<T> dest) >> std::copy_backward (src.begin (), src.end (), dest.end ()); >> } >> >> +namespace ranges { >> + >> +/* Replace all occurrences of a value in the provided range. >> + >> + Note: this helper is a reimplementation of std::ranges::replace, only >> + available from C++20 onwards, and consequently, should be replaced by >> + std::ranges::replace once GDB switches to C++20. */ >> + >> +template <class Range, typename T> >> +void replace (Range r, const T &old_value, const T &new_value) > > Looking at the linked cppreference page, the C++20 functions take R as > 'Range &&r'. Doesn't your versions create a copy of the range? This > will work fine for non-owning ranges, like gdb::array_view, but will > mean replace operates on a copy of the range for something like > std::vector. Even if what you have above is intentional, I think this > difference should be highlighted and explained. > > Also, as this isn't specifically tied to gdb::array_view, I wonder if > this would be better put into a new file gdbsupport/ranges.h ? I don't > think anything much is needed to create the new file other than just > adding the file, so that should be pretty easy to do. Just as I hit send I realised that I should also say this would benefit from some unittests, see gdb/unittests/ for examples. Thanks, Andrew
diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h index 8431d7f5add..f9842ecff30 100644 --- a/gdbsupport/array-view.h +++ b/gdbsupport/array-view.h @@ -225,6 +225,22 @@ void copy (gdb::array_view<U> src, gdb::array_view<T> dest) std::copy_backward (src.begin (), src.end (), dest.end ()); } +namespace ranges { + +/* Replace all occurrences of a value in the provided range. + + Note: this helper is a reimplementation of std::ranges::replace, only + available from C++20 onwards, and consequently, should be replaced by + std::ranges::replace once GDB switches to C++20. */ + +template <class Range, typename T> +void replace (Range r, const T &old_value, const T &new_value) +{ + std::replace (r.begin (), r.end (), old_value, new_value); +} + +} /* namespace ranges */ + /* Compare LHS and RHS for (deep) equality. That is, whether LHS and RHS have the same sizes, and whether each pair of elements of LHS and RHS at the same position compares equal. */