From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2AR3Al6ghmfjBA8AWB0awg (envelope-from ) for ; Tue, 14 Jan 2025 12:35:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1736876125; bh=6fN/0VZt5sOuVxoNYUHL2k2DpiA1ao3Ltv3m0RG8g9k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lhA1jVVrmNW4Rc8o5ZRuuEKYmvu2qpAnwHU/Bap9Po71KIz9aEj7vhllF//frR6JJ iQ6xw9YYFonxENITMFZbqIywtrqZWIxT1sHyF0GkShAFAiyO5l4mF3Qy3rY7WSiTN1 jbKWI3uDzPPyKPspTQWs0e8dM5MlyireDThVOIQ0= Received: by simark.ca (Postfix, from userid 112) id EE8201E100; Tue, 14 Jan 2025 12:35:25 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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=unavailable autolearn_force=no version=4.0.0 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=nBD7dtrd; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=QeV4jsbQ; 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 5BF1B1E05C for ; Tue, 14 Jan 2025 12:35:25 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F1F1E3856256 for ; Tue, 14 Jan 2025 17:35:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1F1E3856256 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=nBD7dtrd; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=QeV4jsbQ Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id A4E95385B529 for ; Tue, 14 Jan 2025 17:34:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4E95385B529 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 A4E95385B529 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=1736876091; cv=none; b=u+DIe6t0VpFoH56sWYt1YO2uyHCCM1BCGHFrgpBuCnE9VcweKAg5L9AEjEHnvZTDCyqN59z1VYtAA+s+wv2EUoHZNsRMl6dydrJDFWEdyXM+WbtBp5RkjbhwGBF5vwgsgZ2B9RueGXwx0hrQiT2+SjRNHg8RhYDVl/kkN0k5/KA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736876091; c=relaxed/simple; bh=6fN/0VZt5sOuVxoNYUHL2k2DpiA1ao3Ltv3m0RG8g9k=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=CVnQsEFRj0mxX5cog8XmXdX203YXzYTKxpWU2UA8Gc8dIEHREgxTrCM6svAcNLfuDFE51ImbbNpBBnVbgeySXH95RD9w3AA55/LTn6KD91HMMC7FIUtDoRHG3NnQ4gu9ypS0yKmK95oa2OolW8qMsJeZYG17rnEPsCPp8Fwzj2s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4E95385B529 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1736876091; bh=6fN/0VZt5sOuVxoNYUHL2k2DpiA1ao3Ltv3m0RG8g9k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nBD7dtrdmJyY4vOGVIFLCLDds4UfpAVNU5233FPfDdCW6zYsUofsGrLdh9MssUPSV WXt9o2kh1CDJslLETPtzyOlhjO11JRkZRVqj+l5NHWFbsRbm0WDQdV8BE5nvCTf5QX CXogLZPqbKFDrc380f1a5rgfDnV63eFipSgVPWLE= Received: by simark.ca (Postfix, from userid 112) id 552541E105; Tue, 14 Jan 2025 12:34:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1736876090; bh=6fN/0VZt5sOuVxoNYUHL2k2DpiA1ao3Ltv3m0RG8g9k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QeV4jsbQh9D+iRsSu1ilj1b/dDmvfWaQMRu3AUcLg+XiiueFouflWSNHx78fkdWLR Ln7taMyBrTX4NWZArSg2m1Od9j9y3m7U7C332DH8THldl6Br2I3G7ObG3ov/rPPt/O DY1REO2x4e2jxTbDT2Xgt4nAJPlWW8K/yVSAD6fI= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 260DA1E05C; Tue, 14 Jan 2025 12:34:50 -0500 (EST) Message-ID: Date: Tue, 14 Jan 2025 12:34:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdbserver: convert program_args to a single string To: Tom Tromey Cc: Andrew Burgess , gdb-patches@sourceware.org, Guinevere Larsen References: <87ldvdqpgb.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87ldvdqpgb.fsf@tromey.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-01-14 12:23, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > >>> /* Start a new process. >>> PROGRAM is the program name. >>> - PROGRAM_ARGS is the vector containing the inferior's args. >>> + PROGRAM_ARGS is a string containing all the inferior's arguments. >>> Returns the new PID on success, -1 on failure. Registers the new >>> process with the process list. */ > > Simon> I think this comment should just be removed, there's no point in > Simon> repeating the documentation from the base class. > > FWIW I normally consider the "override" keyword to be sufficient > documentation in these cases; though there's also some code with a > comment pointing at the base class. Speaking of this, I don't really know what to do in these situations, I'd like if we could clarify what our style is. Let's say you have: -- base.h struct base { /* 1 */ virtual void method (); }; -- base.c /* 2 */ void base::method () { } -- impl.c struct impl : public base { /* 3 */ void method () override; }; /* 4 */ void impl::method () { } Which comment should you have where? We typically say "all declarations and definitions should have a comment", but I feel like it's unnecessary here. - #1 is where you should have the documentation about the behavior of `method` - #2 would be the typical /* See base.h. */, although I find these comments a bit useless - As you said, I think the `override` keyword is sufficient to make comment #3 unnecessary, unless you want to specify something specific to `impl`. I don't see the need to point to the base class, that's just implied by how the language works. - I never know what to put for #4, you can't put /* See impl.c. */, since you're already in impl.c. Again, I feel like a "See whatever" comment is a bit useless: if you know C++, you know you need to go look at the declaration of struct/class `impl`. Simon