aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-04-01 18:14:03 +0000
committerJim Blandy <jimb@codesourcery.com>2004-04-01 18:14:03 +0000
commit408752b0e1531a9da3a29d638d24fc3f3d86fecd (patch)
tree2f295698070d044df3f6b5adfcac223881a7aca8
parentf86ef5a3a24cdfc4ab8c269b5e9fb2c66b787831 (diff)
downloadfsf-binutils-gdb-408752b0e1531a9da3a29d638d24fc3f3d86fecd.zip
fsf-binutils-gdb-408752b0e1531a9da3a29d638d24fc3f3d86fecd.tar.gz
fsf-binutils-gdb-408752b0e1531a9da3a29d638d24fc3f3d86fecd.tar.bz2
* i386-tdep.c: Add FIXME regarding STABS vs. Dwarf 2 register
numbering.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/i386-tdep.c36
2 files changed, 41 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e9bc290..aada64c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-01 Jim Blandy <jimb@redhat.com>
+
+ * i386-tdep.c: Add FIXME regarding STABS vs. Dwarf 2 register
+ numbering.
+
2004-04-01 Paul N. Hilfinger <Hilfinger@gnat.com>
* valarith.c: Update copyright notice.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 84c6818..b3a2793 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -166,6 +166,42 @@ i386_register_name (int reg)
return NULL;
}
+
+/* FIXME: jimb/2004-04-01: I don't think these functions are right.
+ For a given platform, GCC always uses the same register numbering
+ in both STABS and Dwarf2: gcc/dbxout.c and gcc/dwarf2out.c both use
+ the DBX_REGISTER_NUMBER macro, as defined by the config headers.
+ If you compile a program so that its variables are allocated to
+ floating-point registers, first with STABS and again with Dwarf 2,
+ you'll see that the variable's register numbers are the same in
+ each case.
+
+ GCC does use (at least) two different register numberings on the
+ i386; they differ in how they number %ebp, %esp, %eflags, and the
+ floating-point registers. And it has a third numbering for "64bit
+ mode", which I assume is x86_64. But it always uses a given
+ numbering in both STABS and Dwarf.
+
+ This does not match the arrangement we have below, which presumes
+ that STABS and Dwarf numberings are different, and does some
+ strange mixing and matching (e.g., registering the Dwarf 2 function
+ as the STABS function for "Generic i386 ELF") to get close enough
+ to the right effect on the platforms we care about.
+
+ If we wanted to match GCC, we should have two separate register
+ number translation functions (we handle x86_64 in a separate tdep
+ file altogether), one corresponding to each of GCC's i386 register
+ maps. And for a given platform, we would register one of them as
+ both the STABS and Dwarf 2 functions.
+
+ However, we don't aspire to match GCC; we aspire to match the
+ native system's tools. I don't have access to lots of different
+ native compilers and debuggers to verify that GCC is matching their
+ behavior in this regard. Is it sufficient to argue that we at
+ least want to match GNU's compiler, and say we'll fix bugs relative
+ to native tools as they're reported? */
+
+
/* Convert stabs register number REG to the appropriate register
number used by GDB. */