This is the mail archive of the
mailing list for the GDB project.
Re: [RFC]: remove inconsistency in printcmd.c: print_scalar_formatted
(gdb) print/x doublevar
>$1 = 0xc000000000000000
>(gdb) print/i doublevar
>???? [no preference really]
No. That would be wrong. print/<format> prints the value (not the
implementation) using the specified format. Being able to examine the
underlying implementation in various formats is more of an "examine"
Andrew, please explain to us all how you can respond to "I think this
would be a better, different-than-the-current behavior" with "No, that
would be wrong".
"print" displays the value, not the underlying representation, using
normal language rules. Consider:
int i = 1.0;
extern foo (int i);
which don't leave something like 0xc0000000 in i. On the other hand
"examine" lets you display the underlying [memory] representation in
The problem here is not print/f, but rather that there isn't way to
examine the underlying representation of non-memory values (most often
registers) this leaves people attempting: