Module Name: src
Committed By: matt
Date: Sun Feb 5 17:40:48 UTC 2012
Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-thread.c vaxbsd-nat.c
Log Message:
Deal with vax defining [an empty] struct fpreg;
Add supply_gregset and fill_gregset for nbsd-thread.c to vaxbsd-nat.c
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gdb/dist/gdb/nbsd-thread.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.8 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.9
--- src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.8 Wed Jan 25 16:48:44 2012
+++ src/external/gpl3/gdb/dist/gdb/nbsd-thread.c Sun Feb 5 17:40:48 2012
@@ -42,10 +42,11 @@
#include "observer.h"
#include <machine/reg.h>
-#ifndef __sh3__
-#define HAVE_FPREGS
-#else
+#ifdef __sh3__
struct fpreg { };
+#elif defined(__vax__)
+#else
+#define HAVE_FPREGS
#endif
#ifndef HAVE_GREGSET_T
Index: src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c:1.3 Sun Jan 22 20:27:28 2012
+++ src/external/gpl3/gdb/dist/gdb/vaxbsd-nat.c Sun Feb 5 17:40:48 2012
@@ -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 @@ vaxbsd_collect_gregset (const struct reg
}
}
+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 @@ static void
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) ®s, TIDGET (inferior_ptid)) == -1)
- perror_with_name (_("Couldn't get registers"));
+ fill_gregset (regcache, &gregs, regnum);
- vaxbsd_supply_gregset (regcache, ®s);
+ vaxbsd_supply_gregset (regcache, &gregs);
}
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
@@ -84,22 +104,16 @@ static void
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) ®s, TIDGET (inferior_ptid)) == -1)
- perror_with_name (_("Couldn't get registers"));
+ fill_gregset (regcache, &gregs, regnum);
- vaxbsd_collect_gregset (regcache, ®s, regnum);
+ vaxbsd_collect_gregset (regcache, &gregs, regnum);
- if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_TYPE_ARG3) ®s, 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>