Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* i386 register numbering
@ 2001-07-28  3:14 Eli Zaretskii
  2001-07-28  4:56 ` Mark Kettenis
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2001-07-28  3:14 UTC (permalink / raw)
  To: gdb

Consider the following program:

#include <stdio.h>

double one = 1.0;

int main (void)
{
  double d;

  d = 2.0*one;
  printf ("%f\n", d);
  return 0;
}

Now observe:

  gcc -g -O -o ftest.exe ftest.c
  gdb ftest.exe
  (gdb) break 10
  Breakpoint 1 at 0x15fe: file ftest.c, line 10
  (gdb) run
  Starting program: ftest.exe

  Breakpoint 1, main () at ftest.c:10
  10	printf ("%f\n", d);
  (gdb) info address d
  Symbol "d" is a variable in register ds.

In fact, `d' is in st(0), of course.

This happens because the numbering of registers used by GCC differs
from the one used by GDB, see gcc/config/i386/i386.h in the GCC
distribution.  Since i386.h seems to be common for all i386 targets,
I'd expect this problem to pop up on other x86 targets as well (the
above was tested with DJGPP native debugging).

Do others indeed see this bug?  If so, what would be the best way of
fixing it?


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-07-28 18:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-28  3:14 i386 register numbering Eli Zaretskii
2001-07-28  4:56 ` Mark Kettenis
2001-07-28  5:14   ` Eli Zaretskii
2001-07-28  8:12     ` Andrew Cagney
2001-07-28 10:41       ` Mark Kettenis
2001-07-28 11:06         ` Andrew Cagney
2001-07-28 15:02           ` Mark Kettenis
2001-07-28 18:06             ` Andrew Cagney
2001-07-28 11:02     ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox