Re: [PATCH] i386_stab_reg_to_regnum (4 <-> 5, ebp <-> esp)

Jim Blandy
2004-04-07T16:46:39Z

Mark Kettenis <kettenis@chello.nl> writes:
> Jim, please apply this patch, with the proper ChangeLog of course.

Committed, thanks.

2004-04-07 Jim Blandy <jimb@redhat.com>

* i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for
%esp and %ebp

Index: gdb/i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.182
diff -c -r1.182 i386-tdep.c
*** gdb/i386-tdep.c 1 Apr 2004 18:14:03 -0000 1.182
--- gdb/i386-tdep.c 7 Apr 2004 16:42:08 -0000
***************
*** 211,218 ****
/* This implements what GCC calls the "default" register map. */
if (reg >= 0 && reg <= 7)
{
! /* General-purpose registers. */
! return reg;
}
else if (reg >= 12 && reg <= 19)
{
--- 211,223 ----
/* This implements what GCC calls the "default" register map. */
if (reg >= 0 && reg <= 7)
{
! /* 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)
{