This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PING: Re: [PATCH] Print <unavailable> for unavailable registers
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 24 Oct 2013 20:44:12 +0100
- Subject: Re: PING: Re: [PATCH] Print <unavailable> for unavailable registers
- Authentication-results: sourceware.org; auth=none
- References: <5200F594 dot 3050402 at broadcom dot com> <5239BD47 dot 2020101 at broadcom dot com> <5239CF96 dot 4050800 at redhat dot com> <525EA208 dot 7000107 at broadcom dot com>
On 10/16/2013 03:26 PM, Andrew Burgess wrote:
> On 18/09/2013 5:06 PM, Pedro Alves wrote:
>
>>> Index: ./gdb/infcmd.c
>>> ===================================================================
>>> RCS file: /cvs/src/src/gdb/infcmd.c,v
>>> retrieving revision 1.335
>>> diff -u -p -r1.335 infcmd.c
>>> --- ./gdb/infcmd.c 18 Sep 2013 14:02:31 -0000 1.335
>>> +++ ./gdb/infcmd.c 18 Sep 2013 14:43:13 -0000
>>> @@ -2030,7 +2030,8 @@ default_print_one_register_info (struct
>>>
>>> if (!value_entirely_available (val))
>>> {
>>> - fprintf_filtered (file, "*value not available*\n");
>>> + val_print_unavailable (file);
>>> + fprintf_filtered (file, "\n");
>>> return;
>>> }
>>> else if (value_optimized_out (val))
>>
>> Why do we do this instead of just deferring to val_print though?
>> val_print would be able to print partially available registers,
>> for instance.
>>
>> (We'd need to do something about the "raw" printing bits below
>> though.)
>
> OK that's a reasonable point. I've rewritten this patch to make use
> of the val_print call to print the <not-saved> / <unavailable>.
>
> For now I unconditionally skip the second attempt to print the value,
> the "raw" form, for optimized-out and unavailable values, we might
> be able to do better in the future but I was keen to avoid output
> like this: "rax: <unavailable> <unavailable>" with the
> <unavailable> being repeated. If the value of a register is
> partially unavailable, and so we did manage to print something then
> it might make sense to try and print the raw form...
Yeah, we could print some character like UU or XX or $$ or some such
for the unavailable bytes, for example, like, say, printing
a 32-bit var:
<unavailable> 0011UUUU
>
> Is this OK to apply?
OK.
Thanks,
--
Pedro Alves