From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B788D3858281 for ; Thu, 19 Oct 2023 16:07:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B788D3858281 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B788D3858281 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697731632; cv=none; b=p9C+Ot/be86a1TfnAQJbgku4Zxt4KSM84VPOsXa01qQYnVtGEZNKJBA7QB+0i2TudfrhyZzkHrVHQYO4Q3EPFb6d47V6jNCNaV4N3YVLmq6Wm3WK8eTMsMGJXvFx4Rjg445/fr2MgvKadEHe48m5K24OlWA0k5/+Ofon+BbXn1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697731632; c=relaxed/simple; bh=/Fq3pYAhX+38X08nW+fHrslR2S+IS7A4t3aiU0ewjQM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=hgV6xF7C9ehzuM1j0FbP/akFbL5hfUXMpkZozlP9wuJEMhHHpOoA110Tg6gRDzaz20R7QO1Q7hefcUekw2fjdBcXFaItC42aomYzR3PxFhyJUTyRTB/3KHutslUg6kmgRQya3WLNKrLMqLDS6siXRineBbZnm+mSbZ6Vuq0/aS8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 39JG706R012136 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 12:07:05 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 39JG706R012136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1697731625; bh=DX+UUeYtcperpfJED4GaveVYlKwuJDXRIe7ZO/35n7Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gmYe0xI8htNDWiVfYjSJ5CznpLSYzqFTKag6oF4eHOgBZZlafH4h2QfGybH5aRCzU FCSQrmImovgbV2KUUKv/YoSzmfwvS41lEg8UbQE9Auj5F4uuQtGlO+1acHKHc96Ymg dy+FrWwM4qXbIMXV9Ux86ndZ6y3XyzHYgGtjqaV0= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (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 AC1991E00F; Thu, 19 Oct 2023 12:07:00 -0400 (EDT) Message-ID: <9980c898-1e66-45dc-8302-dbc1eb2ade0d@polymtl.ca> Date: Thu, 19 Oct 2023 12:07:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/24] gdb: replace some so_list parameters to use references Content-Language: fr To: Lancelot SIX , Simon Marchi Cc: gdb-patches@sourceware.org References: <20231010204213.111285-1-simon.marchi@efficios.com> <20231010204213.111285-5-simon.marchi@efficios.com> <20231019110750.34bk5fflxalsb4tw@khazad-dum> <560f3443-5089-4af2-94d5-efc7bbd92684@polymtl.ca> <305175fd-a8d4-43f6-b6d2-8cab2aaff7a0@amd.com> From: Simon Marchi In-Reply-To: <305175fd-a8d4-43f6-b6d2-8cab2aaff7a0@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 19 Oct 2023 16:07:01 +0000 X-Spam-Status: No, score=-3031.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,TXREP 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 10/19/23 11:20, Lancelot SIX wrote: > >>>> - void on_solib_loaded (so_list *so) override; >>>> - void on_solib_unloaded (so_list *so) override; >>>> + void on_solib_loaded (const so_list &so) override; >>>> + void on_solib_unloaded (const so_list &so) override; >>> >>> It is orthogonal to this change, but it would make sense for those >>> methods to be const as well. >>> >>> Doing this requires interp::interp_ui_out to be const as well (as done >>> in attached patch). >> >> Why do you think the interp object should be const (which is the effect >> of marking the methods const)? These methods are notifiers to let the >> interp know about certain events that occured. Whether they should >> modify the state of the interpreter or not is up to the particular >> implementation of the interpreter. Perhaps you're right, but I don't >> see it. >> > > It is just that current interps (MI really) are just forwarding notifications. The event does not change the interp's state. > Does it has to be const? No. But usually I tend to make things const unless there is a reason not to. That's all. But if I make the method const for MI, I need to make it const for all interps, including CLI and TUI, right? So then we need to extend the reflection to whether it makes sense to make the method const for them too (hence my question about the non-const ui_out behind a const cli interp). Simon