(amd64bsd_target): New prototype.
* amd64bsd-nat.c: Include "target.h" and "inf-ptrace.h".
(amd64bsd_target): New function.
(amd64bsd_fetch_inferior_registers): Rename from
fetch_inferior_registers. Make static.
(amd64bsd_store_inferior_registers): Rename from
store_inferior_registers. Make static.
* amd64fbsd-nat.c: Include "target.h" and "fbsd-nat.h".
(_initialize_amd64fbsd_nat): Construct and add target vector.
* amd64nbsd-nat.o: Include "target.h".
(_initialize_amd64nbsd_nat): Construct and add target vector.
* amd64obsd-nat.c: Include "target.h".
(_initialize_amd64obsd_nat): Construct and add target vector.
* config/i386/nm-fbsd64.h (CHILD_PID_TO_EXEC_FILE): Remove define.
* config/i386/fbsd64.mh (NATDEPFILES): Remove infptrace.o,
inftarg.o and fbsd-proc.o. Add inf-child.o, inf-ptrace.o and
fbsd-nat.o.
* config/i386/nbsd64.mh, config/i386/obsd64.mh (NATDEPFILES):
Remove infptrace.o and inftarg.o. Add inf-child.o and
inf-ptrace.o.
* Makefile.in (amd64bsd-nat.o, amd64fbsd-nat.o, amd64nbsd-nat.o)
(amd64obsd-nat.o): Update dependencies.
+2004-09-26 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64-nat.h: Update copyright year.
+ (amd64bsd_target): New prototype.
+ * amd64bsd-nat.c: Include "target.h" and "inf-ptrace.h".
+ (amd64bsd_target): New function.
+ (amd64bsd_fetch_inferior_registers): Rename from
+ fetch_inferior_registers. Make static.
+ (amd64bsd_store_inferior_registers): Rename from
+ store_inferior_registers. Make static.
+ * amd64fbsd-nat.c: Include "target.h" and "fbsd-nat.h".
+ (_initialize_amd64fbsd_nat): Construct and add target vector.
+ * amd64nbsd-nat.o: Include "target.h".
+ (_initialize_amd64nbsd_nat): Construct and add target vector.
+ * amd64obsd-nat.c: Include "target.h".
+ (_initialize_amd64obsd_nat): Construct and add target vector.
+ * config/i386/nm-fbsd64.h (CHILD_PID_TO_EXEC_FILE): Remove define.
+ * config/i386/fbsd64.mh (NATDEPFILES): Remove infptrace.o,
+ inftarg.o and fbsd-proc.o. Add inf-child.o, inf-ptrace.o and
+ fbsd-nat.o.
+ * config/i386/nbsd64.mh, config/i386/obsd64.mh (NATDEPFILES):
+ Remove infptrace.o and inftarg.o. Add inf-child.o and
+ inf-ptrace.o.
+ * Makefile.in (amd64bsd-nat.o, amd64fbsd-nat.o, amd64nbsd-nat.o)
+ (amd64obsd-nat.o): Update dependencies.
+
2004-09-25 Mark Kettenis <kettenis@gnu.org>
* config/i386/fbsd.mh (NATDEPFILES): Remove infptrace.o.
$(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \
$(infcall_h) $(elf_bfd_h) $(alpha_tdep_h)
amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h)
+ $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) \
+ $(inf_ptrace_h)
amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) $(bsd_kvm_h)
+ $(target_h) $(gdb_assert_h) $(fbsd_nat_h) $(amd64_tdep_h) \
+ $(amd64_nat_h) $(bsd_kvm_h)
amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
$(amd64_tdep_h) $(solib_svr4_h)
$(solib_svr4_h)
amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
$(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(amd64_tdep_h)
-amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \
- $(amd64_nat_h)
+amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(target_h) $(gdb_assert_h) \
+ $(amd64_tdep_h) $(amd64_nat_h)
amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(osabi_h) $(symtab_h) $(gdb_assert_h) $(amd64_tdep_h) \
$(nbsd_tdep_h) $(solib_svr4_h)
amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
- $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) $(bsd_kvm_h)
+ $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) $(bsd_kvm_h)
amd64obsd-tdep.o: amd64obsd-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
$(symtab_h) $(objfiles_h) $(osabi_h) $(regset_h) $(target_h) \
$(gdb_assert_h) $(gdb_string_h) $(amd64_tdep_h) $(i387_tdep_h) \
/* Native-dependent code for AMD64.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
extern void amd64_collect_native_gregset (const struct regcache *regcache,
void *gregs, int regnum);
+/* Create a prototype *BSD/amd64 target. The client can override it
+ with local methods. */
+
+extern struct target_ops *amd64bsd_target (void);
+
#endif /* amd64-nat.h */
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
+#include "target.h"
/* We include <signal.h> to make sure `struct fxsave64' is defined on
NetBSD, since NetBSD's <machine/reg.h> needs it. */
#include "amd64-tdep.h"
#include "amd64-nat.h"
+#include "inf-ptrace.h"
\f
/* 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)
+static void
+amd64bsd_fetch_inferior_registers (int regnum)
{
if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
/* 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)
+static void
+amd64bsd_store_inferior_registers (int regnum)
{
if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
perror_with_name ("Couldn't write floating point status");
}
}
+
+/* Create a prototype *BSD/amd64 target. The client can override it
+ with local methods. */
+
+struct target_ops *
+amd64bsd_target (void)
+{
+ struct target_ops *t;
+
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = amd64bsd_fetch_inferior_registers;
+ t->to_store_registers = amd64bsd_store_inferior_registers;
+ return t;
+}
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
+#include "target.h"
#include "gdb_assert.h"
#include <signal.h>
#include <sys/sysctl.h>
#include <machine/reg.h>
+#include "fbsd-nat.h"
#include "amd64-tdep.h"
#include "amd64-nat.h"
\f
void
_initialize_amd64fbsd_nat (void)
{
+ struct target_ops *t;
int offset;
amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset;
amd64_native_gregset64_reg_offset = amd64fbsd64_r_reg_offset;
+ /* Add some extra features to the common *BSD/i386 target. */
+ t = amd64bsd_target ();
+ t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
+ t->to_find_memory_regions = fbsd_find_memory_regions;
+ t->to_make_corefile_notes = fbsd_make_corefile_notes;
+ add_target (t);
+
+ /* Support debugging kernel virtual memory images. */
+ bsd_kvm_add_target (amd64fbsd_supply_pcb);
+
/* To support the recognition of signal handlers, i386bsd-tdep.c
hardcodes some constants. Inclusion of this file means that we
are compiling a native debugger, which means that we can use the
amd64fbsd_sigtramp_end_addr = ps_strings;
}
}
-
- /* Support debugging kernel virtual memory images. */
- bsd_kvm_add_target (amd64fbsd_supply_pcb);
}
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "target.h"
#include "gdb_assert.h"
amd64_native_gregset32_reg_offset = amd64nbsd32_r_reg_offset;
amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64nbsd32_r_reg_offset);
amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;
+
+ /* We've got nothing to add to the common *BSD/amd64 target. */
+ add_target (amd64bsd_target ());
}
#include "defs.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "target.h"
#include "gdb_assert.h"
amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64obsd32_r_reg_offset);
amd64_native_gregset64_reg_offset = amd64obsd_r_reg_offset;
+ /* We've got nothing to add to the common *BSD/amd64 target. */
+ add_target (amd64bsd_target ());
+
/* Support debugging kernel virtual memory images. */
bsd_kvm_add_target (amd64obsd_supply_pcb);
}
# Host: FreeBSD/amd64
-NATDEPFILES= fork-child.o infptrace.o inftarg.o \
- amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
- gcore.o fbsd-proc.o bsd-kvm.o
+NATDEPFILES= fork-child.o inf-child.o inf-ptrace.o \
+ fbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
+ gcore.o bsd-kvm.o
NAT_FILE= nm-fbsd64.h
LOADLIBES= -lkvm
# Host: NetBSD/amd64
-NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+NATDEPFILES= fork-child.o inf-child.o inf-ptrace.o \
amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
NAT_FILE= config/nm-nbsd.h
/* Get generic BSD native definitions. */
#include "config/nm-bsd.h"
-/* Override child_pid_to_exec_file in 'inftarg.c'. */
-#define CHILD_PID_TO_EXEC_FILE
-
#endif /* nm-fbsd64.h */
# Host: OpenBSD/amd64
-NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+NATDEPFILES= fork-child.o inf-child.o inf-ptrace.o \
amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
NAT_FILE= config/nm-nbsd.h