www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/04/11/13:56:51

Date: Tue, 11 Apr 2000 13:06:36 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Dieter Buerssner <buers AT gmx DOT de>
cc: djgpp-workers AT delorie DOT com
Subject: Re: One more GDB for DJGPP little oddity
In-Reply-To: <200004101801.OAA29968@delorie.com>
Message-ID: <Pine.SUN.3.91.1000411130627.4929B@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


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