gdb/214: i386-linux: can not display FP constants in integer registers

dan@debian.org dan@debian.org
Sat Sep 15 18:08:00 GMT 2001


>Number:         214
>Category:       gdb
>Synopsis:       i386-linux: can not display FP constants in integer registers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 15 18:08:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     dan@debian.org
>Release:        current
>Organization:
>Environment:
i386-linux
>Description:
Consider:

void tdt(const double x) {
  double doubleVal;
  doubleVal = x;
}

GCC 3.0 will gladly store a DFmode floating point value 
which is only loaded and stored in two integer registers;
for example, in %eax:%edx.  The stabs look like this:

        .stabs  "_Z3tdtd:F(0,21)",36,0,1,_Z3tdtd
        .stabs  "x:p(0,13)",160,0,1,8
...
        .stabs  "x:r(0,13)",64,0,1,0

Translation:  This function takes a double argument, x,
at %ebp+8.  It is then moved into a register.  The register
is 0, or %eax - but this is an eight byte value!  GDB
should be able to figure out that it is in %eax:%edx.  GCC
has (fairly standard, I think) fixed pairings for which
integer registers it will use for such things.  THere is talk about using two arbitrary integer registers, however,
where we'll still lose.

Interestingly, we do even worse with DWARF2.  We don't have
the parameter stab, so we get x wrong in backtraces as
well as when printing it.  With -gstabs, backtraces are
correct.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list