This is the mail archive of the
mailing list for the GDB project.
Re: RFC: Demangle partial symbols and save memory too
David Carlton <firstname.lastname@example.org> 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
Andreas Schwab, SuSE Labs, email@example.com
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."