[RFA] Fix DJGPP register numbering with COFF and stabs debug info

Eli Zaretskii
2009-05-23T11:26:53Z

The default register numbering for COFF and stabs is wrong for DJGPP
native debugging, since the native compiler is GCC. This patch fixes
that.

OK to commit?

2009-05-23 Eli Zaretskii <eliz@gnu.org>

* i386-tdep.c (i386_go32_init_abi): Use SVR4 register numbering
for stabs and COFF debug info.

--- i386-tdep.c~1 2009-04-29 13:40:00.314875000 +0300
+++ i386-tdep.c 2009-05-23 14:16:56.437500000 +0300
@@ -2598,6 +2598,13 @@ i386_go32_init_abi (struct gdbarch_info
/* DJGPP does not support the SSE registers. */
tdep->num_xmm_regs = 0;
set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
+
+ /* Native compiler is GCC, which uses the SVR4 register numbering
+ even in COFF and STABS. See the comment in i386_gdbarch_init,
+ before the calls to set_gdbarch_stab_reg_to_regnum and
+ set_gdbarch_sdb_reg_to_regnum. */
+ set_gdbarch_stab_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
+ set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
}
\f