This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Add native support for "orig_eax" register on Linux/x86
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] Add native support for "orig_eax" register on Linux/x86
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Sun, 4 Nov 2001 15:30:51 +0100
Turns out my previous patch wasn't independent of this one after all.
Here's the bit that actually does fetch and store the "orig_eax"
register such that things work again.
Checked in.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-linux-nat.c (GETREGS_SUPPLIES, supply_gregset,
fill_gregset): Add support for "orig_eax" register.
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.28
diff -u -p -r1.28 i386-linux-nat.c
--- i386-linux-nat.c 2001/05/15 00:03:36 1.28
+++ i386-linux-nat.c 2001/11/04 14:27:45
@@ -88,7 +88,7 @@ static int regmap[] =
/* Which ptrace request retrieves which registers?
These apply to the corresponding SET requests as well. */
#define GETREGS_SUPPLIES(regno) \
- (0 <= (regno) && (regno) <= 15)
+ ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
#define GETFPREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
#define GETFPXREGS_SUPPLIES(regno) \
@@ -306,6 +306,8 @@ supply_gregset (elf_gregset_t *gregsetp)
for (i = 0; i < NUM_GREGS; i++)
supply_register (i, (char *) (regp + regmap[i]));
+
+ supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
}
/* Fill register REGNO (if it is a general-purpose register) in
@@ -321,6 +323,9 @@ fill_gregset (elf_gregset_t *gregsetp, i
for (i = 0; i < NUM_GREGS; i++)
if ((regno == -1 || regno == i))
*(regp + regmap[i]) = *(elf_greg_t *) ®isters[REGISTER_BYTE (i)];
+
+ if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ read_register_gen (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
}
#ifdef HAVE_PTRACE_GETREGS