This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [2/2] Don't raise an error for optimized out sub-fields.
- From: "Andrew Burgess" <aburgess at broadcom dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: "Pedro Alves" <palves at redhat dot com>
- Date: Tue, 30 Jul 2013 16:38:10 +0100
- Subject: Re: [PATCH] [2/2] Don't raise an error for optimized out sub-fields.
- References: <51DEC299 dot 8040109 at broadcom dot com> <51F7D367 dot 8030605 at redhat dot com>
On 30/07/2013 3:53 PM, Pedro Alves wrote:
> On 07/11/2013 03:35 PM, Andrew Burgess wrote:
>> When performing a lazy fetch of a sub-bitfield, we raise an error
>> if the bits have been optimized-out from the parent value. This
>> is odd, as in most other cases we report the value as "<optimized out>".
>
> Agreed. For printing, we aim at being graceful, and not throw
> errors. Errors are left for when computing expressions that
> would require the contents of a non-optimized out value. IOW,
>
> gdb_test "p s.d + 1"
>
> should still throw. Can you confirm that? Might as well add it
> to the test while at it.
Confirmed that we get an error for the example you gave. I've
included a test of this as part of this commit.
>
>> 2013-07-11 Andrew Burgess <aburgess@broadcom.com>
>>
>> * value.c (value_fetch_lazy): Mark optimized out values as such
>> rather than raising an error.
>>
>> gdb/testsuite/ChangeLog
>>
>> 2013-07-11 Andrew Burgess <aburgess@broadcom.com>
>>
>> * gdb.dwarf2/pieces-optimized-out.exp: Expect "<optimized out>"
>
> OK.
Committed.
Thanks,
Andrew