This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Demangle partial symbols and save memory too


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.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]