This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH RFC] PR 17464: Possible improvement for "info vector" command.
- From: Pedro Alves <palves at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, gdb-patches at sourceware dot org
- Date: Tue, 07 Oct 2014 18:31:13 +0100
- Subject: Re: [PATCH RFC] PR 17464: Possible improvement for "info vector" command.
- Authentication-results: sourceware.org; auth=none
- References: <54340ada dot 219e420a dot 2f87 dot ffff8ffcSMTPIN_ADDED_BROKEN at mx dot google dot com>
On 10/07/2014 04:46 PM, Pierre Muller wrote:
> It does have the side effect that
> you can get the same output for an individual vector register
> by using the "/rx" modifier:
>
> (gdb) n
> 35 z = test_xmm14 (z);
> (gdb) p z
> $1 = 56.799999999999997
> Undefined command: "". Try "help".
> (gdb) p /x z
> $2 = 0x38
> (gdb) p /rx z
> $3 = 56.799999999999997 (raw: 0x404c666666666666)
> (gdb)
>
> While in current master git you get the same output
> for /x and /rx modifiers.
For better or worse /r actually means "disable pretty printers":
@item r
@cindex raw printing
Print using the @samp{raw} formatting. By default, @value{GDBN} will
use a Python-based pretty-printer, if one is available (@pxref{Pretty
Printing}). This typically results in a higher-level display of the
value's contents. The @samp{r} format bypasses any Python
pretty-printer which might exist.
@end table
I don't think we should conflate these concepts. If we're
adding a format specifier, I think it should be a different
letter.
In addition:
> (gdb) p /rx z
> $3 = 56.799999999999997 (raw: 0x404c666666666666)
Didn't that lose the hexadecimal (/x) request? I would
expect instead:
(gdb) p /rx z
$3 = 0x38 (raw: 0x404c666666666666)
But it may be better to always print the raw contents when
printing floats, and then have a knob to turn it off,
similar to "set print symbol on/off". Something like
"set print raw-float on/off". Then for e.g.,
float variables in "backtrace", "info locals", etc. also
show their raw contents.
Thanks,
Pedro Alves