This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use common BSD code for FreeBSD/amd64


This makes FreeBSD/amd64 use the common BSD code I introduced
yesterday for NetBSD/amd64.

Checked in.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* amd64fbsd-nat.c (fetch_inferior_registers,
	store_inferior_registers): Remove functions.
	* config/i386/fbsd64.mh (NATDEPFILES): Add amd64bsd-nat.o.

Index: amd64fbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64fbsd-nat.c,v
retrieving revision 1.7
diff -u -p -r1.7 amd64fbsd-nat.c
--- amd64fbsd-nat.c 28 Sep 2003 13:35:44 -0000 1.7
+++ amd64fbsd-nat.c 19 Oct 2003 10:37:52 -0000
@@ -141,77 +141,6 @@ fill_fpregset (fpregset_t *fpregsetp, in
 {
   x86_64_fill_fxsave ((char *) fpregsetp, regnum);
 }
-
-/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
-   for all registers (including the floating point registers).  */
-
-void
-fetch_inferior_registers (int regnum)
-{
-  if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
-    {
-      struct reg regs;
-
-      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-		  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-	perror_with_name ("Couldn't get registers");
-
-      amd64_supply_native_gregset (current_regcache, &regs, -1);
-      if (regnum != -1)
-	return;
-    }
-
-  if (regnum == -1 || regnum >= FP0_REGNUM)
-    {
-      struct fpreg fpregs;
-
-      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
-		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-	perror_with_name ("Couldn't get floating point status");
-
-      x86_64_supply_fxsave (current_regcache, -1, &fpregs);
-    }
-}
-
-/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
-   this for all registers (including the floating point registers).  */
-
-void
-store_inferior_registers (int regnum)
-{
-  if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
-    {
-      struct reg regs;
-
-      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-                  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-        perror_with_name ("Couldn't get registers");
-
-      amd64_collect_native_gregset (current_regcache, &regs, regnum);
-
-      if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
-	          (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-        perror_with_name ("Couldn't write registers");
-
-      if (regnum != -1)
-	return;
-    }
-
-  if (regnum == -1 || regnum >= FP0_REGNUM)
-    {
-      struct fpreg fpregs;
-
-      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
-		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-	perror_with_name ("Couldn't get floating point status");
-
-      x86_64_fill_fxsave ((char *) &fpregs, regnum);
-
-      if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
-		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-	perror_with_name ("Couldn't write floating point status");
-    }
-}
 
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
Index: config/i386/fbsd64.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/fbsd64.mh,v
retrieving revision 1.2
diff -u -p -r1.2 fbsd64.mh
--- config/i386/fbsd64.mh 29 Aug 2003 13:58:26 -0000 1.2
+++ config/i386/fbsd64.mh 19 Oct 2003 10:37:52 -0000
@@ -4,4 +4,4 @@ XM_FILE= xm-i386.h
 
 NAT_FILE= nm-fbsd64.h
 # NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-regset.o amd64-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-regset.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]