This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH v4 2/9] Explicit locations: introduce new struct event_location-based API


On 05/19/2015 09:41 PM, Keith Seitz wrote:
>> Note to self: Do we need both non-const and const versions?
>> [e.g., treat cached value as mutable in c++ sense?]
> 
> Yeah, if we could do something like that in C, that would negate the
> need for both versions. As it is, this seemed the easiest (and not
> an uncommon) way to deal with this. If you have another option, I'm all
> eyes.

You can cast away const for that.  See ada_decode_symbol for an example
of exactly that.  "const" in C does not mean that the object is set to
stone in read-only storage.

Thanks,
Pedro Alves


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