From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QQmeCbqZ62jRtysAWB0awg (envelope-from ) for ; Sun, 12 Oct 2025 08:06:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1760270778; bh=yL3TPI+fBKPBJQYs9//hSoiudboS/weP2/qDVs7sn/0=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fw5F03ttYs6q+1gbzubcflY5P2uOsbiiHekRr80RUyXYXZl+F85+5w82X6o4Lkv1F 9J51I6/qshgV/OsG6UDEXySTFdHtnww98qjred5tvO7hU+dM9UYF/OiSC/hPP1jb/P ifqROsbWQBxYicWVIdMSmnHO4SeMBR9UXkpvpcL8= Received: by simark.ca (Postfix, from userid 112) id 241F81E047; Sun, 12 Oct 2025 08:06:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=YDzvj6nf; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 9D2A41E047 for ; Sun, 12 Oct 2025 08:06:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D01E385703B for ; Sun, 12 Oct 2025 12:06:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D01E385703B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=YDzvj6nf Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id F21C93858D3C for ; Sun, 12 Oct 2025 12:05:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F21C93858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F21C93858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760270742; cv=none; b=Fe+QSOf26j4sYNjnGLPC0oWZUsxDvcmaarA5qu1TErKWM19kxp5sbU4OJH3vT/zUvpThF2bqIIk3bQC+lYWulSevnAzrfuopB/aOHdOwEiHgR10ykaVSiJs1DwAXpvya5VD7GYybmMU1IdPZP1aY75VZyEMjYpOkS/l5+iYSkrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760270742; c=relaxed/simple; bh=yL3TPI+fBKPBJQYs9//hSoiudboS/weP2/qDVs7sn/0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=jAWXZNn36ZPHjwH4usOhrRgIcalSoQmHTgPRn6kSrEAiZOMFmUSlpjFDASRsgw20dW3rd1XrhmwoFeMCS2QSvfEUT6B2B+wJoa+dsQFIXEa6SQXcb7VD4sNaMXd33jmLHi5II+Q7iueP6UjyS5IvA1tEbQE52lJWutjjkxEcVaY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F21C93858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1760270741; bh=yL3TPI+fBKPBJQYs9//hSoiudboS/weP2/qDVs7sn/0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=YDzvj6nfMsn/VS6GWH1TEw6olfuxv6Cson/JOef1Xz9TBRVkGgnjSVmWr34B7D7Az 1rSfZ26W2sEcDoKXrPCCshNXieh9rk1ZsvXwW6+9Kqgj9eVQqQUp3mQxn4bZufPCig oonZxqyVcGziSGXHhx1q0iyF6W/OjPMP/0tAU+ks= Received: by simark.ca (Postfix) id 565A51E047; Sun, 12 Oct 2025 08:05:41 -0400 (EDT) Message-ID: Date: Sun, 12 Oct 2025 08:05:40 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] gdb/remote: replace use of std::pair with an actual struct To: Andrew Burgess , gdb-patches@sourceware.org References: <40cbbd9f0082b07e9767656fe044bbe9280983a3.1759763251.git.aburgess@redhat.com> <469655a7-2bcc-4f27-b2d7-3fa8808ca5b5@simark.ca> <87jz104hwc.fsf@redhat.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87jz104hwc.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2025-10-12 04:57, Andrew Burgess wrote: > Simon Marchi writes: > >> On 2025-10-11 09:34, Andrew Burgess wrote: >>> Commit: >>> >>> commit 5edcbe2277db05b77ebf53f9c30b6c889a8729bc >>> Date: Mon Jul 24 17:35:54 2023 +0100 >>> >>> gdb: detect when gdbserver has no default executable set >>> >>> Introduced a use of std::pair as a data structure to hold some per >>> program space information within the program space registry. >>> >>> It was pointed out during review of a later patch that the code would >>> be easier to understand if the std::pair was replaced with a struct >>> with named fields. >>> >>> That is what this commit does. Replace the std::pair with a struct, >>> and update all accesses to use the named fields. >>> >>> There should be no user visible changes after this commit. >> >> Thanks, this LGTM. >> >> Approved-By: Simon Marchi >> >> I would just like to point out that if we ever add more fields to this >> structure (this the remote target needs to record per-pspace), then it >> would probably make sense to rename to to "remote_per_pspace" or >> something like that, since it would no longer be only used to hold >> remote exec information. But as of now, it's correct. > > Ask and you shall receive! > > The update below names the struct remote_per_progspace, and moves the > exec file information into a nested struct. > > Is this better? This looks clean to me, thanks. Approved-By: Simon Marchi Simon