This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Use I386_ESP_REGNUM for *BSD and Linux
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 1 Jun 2003 23:37:14 +0200 (CEST)
- Subject: [PATCH] Use I386_ESP_REGNUM for *BSD and Linux
This avoids a couple of function calls.
Committed.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-linux-nat.c (child_resume): Use I386_ESP_REGNUM instead of
SP_REGNUM.
* i386-linux-tdep.c (i386_linux_sigcontext_addr): Likewise.
* i386bsd-tdep.c (i386bsd_sigcontext_addr): Likewise.
Index: i386bsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-tdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 i386bsd-tdep.c
--- i386bsd-tdep.c 31 May 2003 16:08:06 -0000 1.15
+++ i386bsd-tdep.c 1 Jun 2003 16:44:20 -0000
@@ -50,7 +50,7 @@ i386bsd_sigcontext_addr (struct frame_in
char buf[4];
CORE_ADDR sp;
- frame_unwind_register (next_frame, SP_REGNUM, buf);
+ frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 4);
return read_memory_unsigned_integer (sp + 8, 4);
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.45
diff -u -p -r1.45 i386-linux-nat.c
--- i386-linux-nat.c 4 May 2003 10:18:10 -0000 1.45
+++ i386-linux-nat.c 1 Jun 2003 16:44:21 -0000
@@ -852,7 +852,7 @@ child_resume (ptid_t ptid, int step, enu
/* Then check the system call number. */
if (syscall == SYS_sigreturn || syscall == SYS_rt_sigreturn)
{
- CORE_ADDR sp = read_register (SP_REGNUM);
+ CORE_ADDR sp = read_register (I386_ESP_REGNUM);
CORE_ADDR addr = sp;
unsigned long int eflags;
Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.29
diff -u -p -r1.29 i386-linux-tdep.c
--- i386-linux-tdep.c 31 May 2003 16:08:05 -0000 1.29
+++ i386-linux-tdep.c 1 Jun 2003 16:44:21 -0000
@@ -252,7 +252,7 @@ i386_linux_sigcontext_addr (struct frame
CORE_ADDR sp;
char buf[4];
- frame_unwind_register (next_frame, SP_REGNUM, buf);
+ frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 4);
pc = i386_linux_sigtramp_start (frame_pc_unwind (next_frame));
@@ -291,7 +291,7 @@ i386_linux_sigcontext_addr (struct frame
static void
i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid)
{
- write_register_pid (PC_REGNUM, pc, ptid);
+ write_register_pid (I386_EIP_REGNUM, pc, ptid);
/* We must be careful with modifying the program counter. If we
just interrupted a system call, the kernel might try to restart