Mail Archives: djgpp-workers/2000/04/10/09:44:35
[I have missed the mail by Pierre Muller, so I am replying to Eli]
On 9 Apr 00, at 8:41, Eli Zaretskii wrote:
> On Fri, 7 Apr 2000, Pierre Muller wrote:
>
> > if I have a long double var named x of value 1e+4893
> > if I print it out
> >
> > "p x"
> > I get
> > " 1e+4893"
> >
> > but once loaded onto FPU stack
> > I get +Inf on the right part of the display !
I have asked a similar question in comp.os.msdos.djgpp. Gdb just
cannot display floating point numbers, that are loaded into the FPU.
(long double is not special, float and double don't work either.)
This seems not to be a DJGPP specific thing. It cannot print the
values on Linux either. Gdb just prints more or less random garbage.
(And I tried the -ggdb and similar options as well.)
To debug floating point, you can try to use the compiler option
-ffloat-store. Then Gdb seems to be able to print the values. But
this has some disadvantages as well, because the results of the
program compiled with and without -ffloat-store may differ (and
a performance penalty, that probably won't matter while debugging) .
> In what version of GDB?
I don't know Pierre's version, but to me, this happened in all
versions of Gdb i tried, including version 4.18.
> > on the contrary p /x $st0 shows 12 bytes whereas only ten are significant
> > (this is better in info float !)
>
> What's wrong with having 12 bytes displayed?
I think, it is misleading to print 12 bytes, for a register that only
containes 10 bytes. The additional 2 bytes are garbage.
--
Regards, Dieter
- Raw text -