From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22708 invoked by alias); 27 Jan 2003 22:24:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22700 invoked from network); 27 Jan 2003 22:24:29 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 27 Jan 2003 22:24:29 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h0RMOMa05842; Mon, 27 Jan 2003 14:24:22 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Andreas Schwab Cc: Andrew Cagney , Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: RFC: Demangle partial symbols and save memory too References: <20030126222808.GA18132@nevyn.them.org> <20030127190109.GA11294@nevyn.them.org> <3E35A2EA.1080906@redhat.com> From: David Carlton Date: Mon, 27 Jan 2003 22:24:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-01/txt/msg00744.txt.bz2 On Mon, 27 Jan 2003 23:17:55 +0100, Andreas Schwab said: > David Carlton writes: >> I also toyed with trying to replace 'struct XXX *' with 'const >> struct XXX *' wherever appropriate. That one's harder, though, >> because there are structures in GDB where values are computed >> lazily and cached: so not only are there functions that are >> logically const but not actually const, but I also worried that >> making too many declarations const now would inhibit such caching >> in the future. Maybe in a couple of years we can switch GDB over >> to C++ instead of C and use 'mutable'... > Even in C casting away const is OK as long as the object isn't > read-only in the first place. You just have to be careful to make > sure this is not violated. That's a good point. I don't like casts, of course, but in this particular situation my dislike of casts might be trumped by my liking of const when logically appropriate. David Carlton carlton@math.stanford.edu