* 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.
This commit is contained in:
Mark Kettenis 2004-09-26 18:42:30 +00:00
parent 43fcb4de8e
commit 6a5c78a350
11 changed files with 85 additions and 21 deletions

View File

@ -1,3 +1,29 @@
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.

View File

@ -1646,9 +1646,11 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \
$(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)
@ -1661,13 +1663,13 @@ amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_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) \

View File

@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
Copyright 2003 Free Software Foundation, Inc.
Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@ -50,4 +50,9 @@ extern void amd64_supply_native_gregset (struct regcache *regcache,
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 */

View File

@ -22,6 +22,7 @@
#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. */
@ -33,13 +34,14 @@
#include "amd64-tdep.h"
#include "amd64-nat.h"
#include "inf-ptrace.h"
/* 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))
{
@ -69,8 +71,8 @@ fetch_inferior_registers (int 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))
{
@ -105,3 +107,17 @@ store_inferior_registers (int 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;
}

View File

@ -22,6 +22,7 @@
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
#include "target.h"
#include "gdb_assert.h"
#include <signal.h>
@ -31,6 +32,7 @@
#include <sys/sysctl.h>
#include <machine/reg.h>
#include "fbsd-nat.h"
#include "amd64-tdep.h"
#include "amd64-nat.h"
@ -138,11 +140,22 @@ void _initialize_amd64fbsd_nat (void);
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
@ -219,7 +232,4 @@ Please report this to <bug-gdb@gnu.org>.",
amd64fbsd_sigtramp_end_addr = ps_strings;
}
}
/* Support debugging kernel virtual memory images. */
bsd_kvm_add_target (amd64fbsd_supply_pcb);
}

View File

@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "target.h"
#include "gdb_assert.h"
@ -65,4 +66,7 @@ _initialize_amd64nbsd_nat (void)
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 ());
}

View File

@ -22,6 +22,7 @@
#include "defs.h"
#include "gdbcore.h"
#include "regcache.h"
#include "target.h"
#include "gdb_assert.h"
@ -138,6 +139,9 @@ _initialize_amd64obsd_nat (void)
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);
}

View File

@ -1,7 +1,7 @@
# 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

View File

@ -1,4 +1,4 @@
# 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

View File

@ -25,7 +25,4 @@
/* 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 */

View File

@ -1,5 +1,5 @@
# 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