From: Jim Blandy Date: Wed, 7 Apr 2004 16:45:45 +0000 (+0000) Subject: * i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9872ad24c3d11b67a92be0e2b63398554b6dbb43;p=binutils-gdb.git * i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for %esp and %ebp --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7cc00a8d693..9129b7da4f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-04-07 Jim Blandy + + * i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for + %esp and %ebp + 2004-04-07 Mark Kettenis * config/sparc/linux.mt (TDEPFILES): Remove solib-legacy.o. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index b3a27931a93..cfe426d3a01 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -211,8 +211,13 @@ i386_stab_reg_to_regnum (int reg) /* This implements what GCC calls the "default" register map. */ if (reg >= 0 && reg <= 7) { - /* General-purpose registers. */ - return reg; + /* General-purpose registers. The debug info calls %ebp + register 4, and %esp register 5. */ + if (reg == 4) + return 5; + else if (reg == 5) + return 4; + else return reg; } else if (reg >= 12 && reg <= 19) {