This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH RFC] PR 17464: Possible improvement for "info vector" command.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]