aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-04-07 16:45:45 +0000
committerJim Blandy <jimb@codesourcery.com>2004-04-07 16:45:45 +0000
commit9872ad24c3d11b67a92be0e2b63398554b6dbb43 (patch)
treec8f3eceaceb06f7d214e78d3f5dc4b3ee3453d1b /gdb/i386-tdep.c
parent1ba93119e8e3d0c01b44ad8317551e5b886783b0 (diff)
downloadgdb-9872ad24c3d11b67a92be0e2b63398554b6dbb43.zip
gdb-9872ad24c3d11b67a92be0e2b63398554b6dbb43.tar.gz
gdb-9872ad24c3d11b67a92be0e2b63398554b6dbb43.tar.bz2
* i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for
%esp and %ebp
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index b3a2793..cfe426d 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)
{