Mail Archives: djgpp-workers/2000/04/11/13:56:51
On Mon, 10 Apr 2000, Dieter Buerssner wrote:
> > But how is gdb supposed to know that? sizeof(long double) *is* 12, after
> > all, and the p /x commands asks for display as single bytes. In that
> > special case, I fail to see any error in displaying the two 'fill' bytes,
> > additionally.
>
> Gdb knows already, that floating point registers are 10 bytes. This
> can be seen by info float, that displays the 10 bytes, while p /x
> $st0 displays 12 bytes.
In GDB 4.18, "info float" is handled by a DJGPP-specific code, while
"p/x $st0" is handled by the general-purpose GDB code; thus the
difference.
In GDB 5.0, "info float" was rewritten to work in the same way for all
x86 platforms. I think Pierre was talking about this version.
> p $st0 really asks to print the floating
> point register, and not to dump the memory, where a long double is
> stored.
What you need to understand is that GDB maintains a register file for
the debuggee, where all the registers for each call frame are stored;
"p $st0" simply fetches the value from that register file. And in the
register file, the FP registers are 12-byte long...
> But, actually, I don't care to much about this. Info float is more
> useful anyway (but needs more screen space).
If you don't need all the info from "info float", try the command
"info registers $st0" instead.
- Raw text -