Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: Andreas Schwab <schwab@suse.de>,
	Daniel Jacobowitz <drow@mvista.com>,
	gdb-patches@sources.redhat.com
Subject: Re: RFC: Demangle partial symbols and save memory too
Date: Mon, 27 Jan 2003 23:17:00 -0000	[thread overview]
Message-ID: <3E35BDFB.7020306@redhat.com> (raw)
In-Reply-To: <ro1of62p6y1.fsf@jackfruit.Stanford.EDU>

> On Mon, 27 Jan 2003 23:17:55 +0100, Andreas Schwab <schwab@suse.de> said:
> 
>> David Carlton <carlton@math.stanford.edu> 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.

I'd rather not see such casts.  It is easier to recommend no casts then 
to recommend no casts `but'.

The current objective for const is just with strings - getting GDB past 
-Wwriteable-strings so that we know that all constant strings can be 
moved to the text segment.

Andrew



  reply	other threads:[~2003-01-27 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-26 22:27 Daniel Jacobowitz
2003-01-27  1:54 ` Paul N. Hilfinger
2003-01-27  2:02   ` Daniel Jacobowitz
2003-01-27 18:53 ` David Carlton
2003-01-27 19:00   ` Daniel Jacobowitz
2003-01-27 19:10     ` David Carlton
2003-01-27 21:21     ` Andrew Cagney
2003-01-27 22:09       ` David Carlton
2003-01-27 22:17         ` Andreas Schwab
2003-01-27 22:24           ` David Carlton
2003-01-27 23:17             ` Andrew Cagney [this message]
2003-01-28 23:57 ` Jim Blandy
2003-01-30  1:16   ` Daniel Jacobowitz
2003-02-04 18:07     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E35BDFB.7020306@redhat.com \
    --to=ac131313@redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox