This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 2/9] Explicit locations: introduce new struct event_location-based API
- From: Pedro Alves <palves at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>, Doug Evans <xdje42 at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 19 May 2015 23:16:37 +0100
- Subject: Re: [PATCH v4 2/9] Explicit locations: introduce new struct event_location-based API
- Authentication-results: sourceware.org; auth=none
- References: <20150507180523 dot 19629 dot 77846 dot stgit at valrhona dot uglyboxes dot com> <20150507180549 dot 19629 dot 87819 dot stgit at valrhona dot uglyboxes dot com> <m3vbfrsz6p dot fsf at sspiff dot org> <555B9FE1 dot 7050603 at redhat dot com>
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