www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/04/10/09:44:35

Message-Id: <200004101325.JAA17297@delorie.com>
From: "Dieter Buerssner" <buers AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Date: Mon, 10 Apr 2000 16:27:45 +0200
MIME-Version: 1.0
Subject: Re: One more GDB for DJGPP little oddity
References: <200004071340 DOT PAA16017 AT cerbere DOT u-strasbg DOT fr>
In-reply-to: <Pine.SUN.3.91.1000409084054.7469R-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp-workers AT delorie DOT com

[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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019