From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UGkJBP1U92q+RgkAWB0awg (envelope-from ) for ; Fri, 13 Nov 2026 13:20:45 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=V7IV3qA6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F413B1E0BC; Fri, 13 Nov 2026 13:20:44 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 8C92E1E087 for ; Fri, 13 Nov 2026 13:20:44 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10C734B1768F for ; Fri, 13 Nov 2026 18:20:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10C734B1768F Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=V7IV3qA6 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id ABB9C4BA23F4 for ; Fri, 13 Nov 2026 18:20:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABB9C4BA23F4 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABB9C4BA23F4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794594017; cv=none; b=ZuW6or0yJNOu/FO14QhIONhl+Uty0cgAJ/NqjIzRbrNk2DSvk4XYvoxeh5IlQ3FauiTB31y7LYSWjeUf2Vi+Hn8lb6PzEqD9OVDVI7FYXiGymmewvutGTMAwhfkF/OZp4smvFzC8WyPIr7aGePG2p8U6TYEae3bK/SGms3P7Zfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794594017; c=relaxed/simple; bh=QEZjlCnZqjdPbEHzxuD16KZ7DmTFwurUY9l9BDJQYKw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YqH9QfHY8txwNaXDx8BuL+wgd7jTwOtSlsWDrACKqUPrWCWfH7ZNxalwWac0JHnFdSh3YVue7/ngMjTrq48sqDUaw+FzzYpvvESBXiClrePkhT6D7YwqoVevqop4cGY2DU4iCAgmTkS4Ts9QjBgVosekZ8hlMxJTQxNj8Enq30c= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=V7IV3qA6 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABB9C4BA23F4 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id RcpvxhZ61AR1iRvsmxI16t; Fri, 13 Nov 2026 18:20:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id RvslxMEqQSgq1Rvslxtow9; Fri, 13 Nov 2026 18:20:15 +0000 X-Authority-Analysis: v=2.4 cv=c8KrQQ9l c=1 sm=1 tr=0 ts=6af754df a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=zJRp6_cAMcgA:10 a=ItBw4LHWJt0A:10 a=7CQSdrXTAAAA:8 a=dnSo2f4t7GfjVYtfI2kA:9 a=a-qgeE7W1pNrGK8U0ZQC:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PpNSVmN4pFQr+kkT7lgNrVFSVJocjyhWK0VMY2s7dZE=; b=V7IV3qA6lHpGoB7rH3NuXWqrhh 4RNFErtZgmxogypXa6Riit4CKWCpT9z4MJzxk9BcI6hAzN54/OG6ZrxsMHVg/XidGPef4ZlncZgLc dNCofkQQhVXfCd6qzQL5DDRlO; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:36542 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xRvsk-00000001v1j-3KK3; Fri, 13 Nov 2026 11:20:14 -0700 From: Tom Tromey To: Matthieu Longo Cc: Tom Tromey , gdb-patches@sourceware.org, Andrew Burgess Subject: Re: [PATCH v3 4/8] gdbsupport: add extract_next_field helper In-Reply-To: <7c22c0e1-8c0f-47f3-bac8-90ffbacc021c@arm.com> (Matthieu Longo's message of "Tue, 10 Nov 2026 12:51:59 +0000") References: <20260922135050.236941-1-matthieu.longo@arm.com> <20260922135050.236941-5-matthieu.longo@arm.com> <871p8zxaqz.fsf@tromey.com> <7c22c0e1-8c0f-47f3-bac8-90ffbacc021c@arm.com> X-Attribution: Tom Date: Fri, 13 Nov 2026 11:20:13 -0700 Message-ID: <87v760386a.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.129 X-Source-L: No X-Exim-ID: 1xRvsk-00000001v1j-3KK3 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:36542 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAJ11JoLFDji47CgZ/tnOpjF2NjaJ3hE9DkK31Y6QCB4tqWmhIWRDRAiS1VvdmxaNwmLmSWdI+zrxyrM6MKPezn7xO29Mf8UNz3d4ZxLXgYNEdkllu4n R4OdW98cCbsQwWFngZeHn5WoiyBEvVDf4Yel3sagesbgAZi5/ym7VoBE6HCdiwYT33Aej6DIyr/u8m2MRsAoTBNcTtA/8x5Ue4w= 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 >>>>> Matthieu Longo writes: >> I think adding a new header file in gdbsupport should be pretty easy. >> You don't even have to patch the build. > How would you name the header ? common-string.h ? > I am really not inspired this morning... :/ Many will attest that I am not the best at naming. However, how about "extract-field.h" or "extract-next-field.h". My reasoning is that if that name is unclear, then so is the function name. > If I were to change the code to: > auto it = std::find (start, buffer.end (), separator); > /* If a separator is found, update next_start to the position of the > found separator. */ > if (it != buffer.end ()) > next_start = it; > return {ViewT (start, it), next_start}; > Without the second loop, trailing separators would cause an extra empty string to be returned. > For example, "\n1234\nabc\n\ndef\n\n" would produce: > {"1234", "abc", "def", ""} > instead of: > {"1234", "abc", "def"}. > I think skipping the trailing separators keeps the behavior consistent > and avoids having callers to handle this edge case. Makes sense, perhaps a small comment would help here. thanks, Tom