From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 990373858D33 for ; Fri, 22 Dec 2023 03:39:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 990373858D33 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 990373858D33 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=1703216383; cv=none; b=rlLT9F++wAYO1fMXNf8NClAyE89hcV8re4Jqr0WtiTQ4FKPvXg+8B90xqZ0G16KMqD89fVeWSlHDhZN/iWbwVp9dKlt/067GpOkhr4nyqOsAYC3kfgJK5//6POwtEe5AhwGJOE2DvpRviVtK1LCCMynB9DaH36tOZZLuMj24f2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703216383; c=relaxed/simple; bh=bE3iYzqrJgZ5DrdFd5+v0z0Q9LTH95QYt4xZyiDF2d4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=RwDvrbGPk1nH0adj29vkOF77xoEJLUx1nwZwzzVGyogUV1JJLWzrS1M0PFDsHwjqCjQ4nMtq78XxhCLDsTMBMZCtQsPEBmHvO/N57pymd2fKrAmxTrIoVQ9xBJLFmSP3JEePO/LBjI59GX3nsTvz10xVKtHo0jb7Qu7I8m4241c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1703216382; bh=bE3iYzqrJgZ5DrdFd5+v0z0Q9LTH95QYt4xZyiDF2d4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=BEi3RU7YvhqjE/mlcF0/1dfaaJrFzjNO+RUy5th9366PMMblBlj5FHeXV/Wc+5Pe5 MfO2lTQcgpozdDgbNnwVjycyMCTedRTPlLwQgSmHYqOiro8O/w1N/DYBGNqCiiIA0P 7aknAEq440PZFShASn49vlInnRRGu09SKjs3pin4= 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 3CE531E091; Thu, 21 Dec 2023 22:39:42 -0500 (EST) Message-ID: Date: Thu, 21 Dec 2023 22:39:41 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 20/26] gdbserver: make some regcache fields private Content-Language: en-US To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-02-28 06:28, Tankut Baris Aktemur via Gdb-patches wrote: > Some fields of the regcache struct are used for internal state > tracking. Prevent direct access to them from outside by making them > private. This is a good step, but it would be nice to: - rename private fields to prefix them with `m_`. When accessing fields that are not prefixed with `m_`, I like to use `this->`, otherwise it's not obvious what you are acessing. With the prefix though, I don't think it's necessary, as the naming makes it obvious. It then makes the code a bit more concise. - reorder members of the class to be somewhat in standard order. I don't think we have a strict rule about this, but it's typically: constructor, destructor, public methods, public fields, private methods, private fields. I don't mind if this is done by editing the patches in this series, or as a change on top, if it's easier. Simon