Re: PING: Re: [PATCH] Print for unavailable registers

Pedro Alves
2013-09-18T16:06:51Z

On 09/18/2013 03:48 PM, Andrew Burgess wrote:
> On 06/08/2013 2:09 PM, Andrew Burgess wrote:
>> Following on from (but unrelated to) this mail:
>> http://sourceware.org/ml/gdb-patches/2013-08/msg00170.html
>>
>> Printing "*value not available*" for unavailable values within
>> "info registers" seems inconsistent to me, if we just print an
>> unavailable register we'll get "<unavailable>".
>>
>> The patch below makes "info registers" print "<unavailable>".
>
> I've re-written this patch, here's the latest version.
>
> OK to apply?

I was waiting for the "<not saved>" discussion patch to
finalize before looking at this one. Looks like only a docs
review is missing so that should be soon.

> 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.)

--
Pedro Alves