From 9872ad24c3d11b67a92be0e2b63398554b6dbb43 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 7 Apr 2004 16:45:45 +0000 Subject: [PATCH] * i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for %esp and %ebp --- gdb/ChangeLog | 5 +++++ gdb/i386-tdep.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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) { -- 2.30.2