diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index cfdb3e79a8e..d724e6c8c25 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,10 @@ +2015-02-23 Pedro Alves + + * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit + modes. + (x86_fill_gregset, x86_store_gregset): Use it when handling + $orig_eax. + 2015-02-20 Pedro Alves * thread-db.c: Include "nat/linux-procfs.h". diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 2c3fccca811..e58a7aca5e0 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -176,6 +176,7 @@ static /*const*/ int i386_regmap[] = /* So code below doesn't have to care, i386 or amd64. */ #define ORIG_EAX ORIG_RAX +#define REGSIZE 8 static const int x86_64_regmap[] = { @@ -221,6 +222,8 @@ static /*const*/ int i386_regmap[] = #define I386_NUM_REGS (sizeof (i386_regmap) / sizeof (i386_regmap[0])) +#define REGSIZE 4 + #endif #ifdef __x86_64__ @@ -374,7 +377,7 @@ x86_fill_gregset (struct regcache *regcache, void *buf) collect_register (regcache, i, ((char *) buf) + i386_regmap[i]); collect_register_by_name (regcache, "orig_eax", - ((char *) buf) + ORIG_EAX * 4); + ((char *) buf) + ORIG_EAX * REGSIZE); } static void @@ -396,7 +399,7 @@ x86_store_gregset (struct regcache *regcache, const void *buf) supply_register (regcache, i, ((char *) buf) + i386_regmap[i]); supply_register_by_name (regcache, "orig_eax", - ((char *) buf) + ORIG_EAX * 4); + ((char *) buf) + ORIG_EAX * REGSIZE); } static void