Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdb Deal with vax defining [an empty]...



details:   https://anonhg.NetBSD.org/src/rev/d7578868cbfc
branches:  trunk
changeset: 773546:d7578868cbfc
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Feb 05 17:40:48 2012 +0000

description:
Deal with vax defining [an empty] struct fpreg;
Add supply_gregset and fill_gregset for nbsd-thread.c to vaxbsd-nat.c

diffstat:

 external/gpl3/gdb/dist/gdb/nbsd-thread.c |   7 ++--
 external/gpl3/gdb/dist/gdb/vaxbsd-nat.c  |  44 +++++++++++++++++++++----------
 2 files changed, 33 insertions(+), 18 deletions(-)

diffs (101 lines):

diff -r 26a7eda57699 -r d7578868cbfc external/gpl3/gdb/dist/gdb/nbsd-thread.c
--- a/external/gpl3/gdb/dist/gdb/nbsd-thread.c  Sun Feb 05 17:40:08 2012 +0000
+++ b/external/gpl3/gdb/dist/gdb/nbsd-thread.c  Sun Feb 05 17:40:48 2012 +0000
@@ -42,10 +42,11 @@
 #include "observer.h"
 
 #include <machine/reg.h>
-#ifndef __sh3__
+#ifdef __sh3__
+struct fpreg { };
+#elif defined(__vax__)
+#else
 #define HAVE_FPREGS
-#else
-struct fpreg { };
 #endif
 
 #ifndef HAVE_GREGSET_T
diff -r 26a7eda57699 -r d7578868cbfc external/gpl3/gdb/dist/gdb/vaxbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c   Sun Feb 05 17:40:08 2012 +0000
+++ b/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c   Sun Feb 05 17:40:48 2012 +0000
@@ -31,6 +31,10 @@
 #include "vax-tdep.h"
 #include "inf-ptrace.h"
 
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
 /* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
 
 static void
@@ -60,6 +64,24 @@
     }
 }
 
+void
+supply_gregset (struct regcache *regcache, const gregset_t *gregs)
+{
+  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+             (PTRACE_TYPE_ARG3) gregs, TIDGET (inferior_ptid)) == -1)
+    perror_with_name (_("Couldn't write registers"));
+}
+
+void
+fill_gregset (const struct regcache *regcache, gregset_t *gregs, int regnum)
+{
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+             (PTRACE_TYPE_ARG3) gregs, TIDGET (inferior_ptid)) == -1)
+    perror_with_name (_("Couldn't get registers"));
+}
+
+
+/* Support for debugging kernel virtual memory images.  */
 
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers.  */
@@ -68,13 +90,11 @@
 vaxbsd_fetch_inferior_registers (struct target_ops *ops,
                                 struct regcache *regcache, int regnum)
 {
-  struct reg regs;
+  gregset_t gregs;
 
-  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, TIDGET (inferior_ptid)) == -1)
-    perror_with_name (_("Couldn't get registers"));
+  fill_gregset (regcache, &gregs, regnum);
 
-  vaxbsd_supply_gregset (regcache, &regs);
+  vaxbsd_supply_gregset (regcache, &gregs);
 }
 
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
@@ -84,22 +104,16 @@
 vaxbsd_store_inferior_registers (struct target_ops *ops,
                                 struct regcache *regcache, int regnum)
 {
-  struct reg regs;
+  gregset_t gregs;
 
-  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, TIDGET (inferior_ptid)) == -1)
-    perror_with_name (_("Couldn't get registers"));
+  fill_gregset (regcache, &gregs, regnum);
 
-  vaxbsd_collect_gregset (regcache, &regs, regnum);
+  vaxbsd_collect_gregset (regcache, &gregs, regnum);
 
-  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, TIDGET (inferior_ptid)) == -1)
-    perror_with_name (_("Couldn't write registers"));
+  supply_gregset (regcache, &gregs);
 }
 
 
-/* Support for debugging kernel virtual memory images.  */
-
 #include <sys/types.h>
 #include <machine/pcb.h>
 



Home | Main Index | Thread Index | Old Index