* linux-nat.c (linux_register_u_offset): Remove.

(linux_target_install_ops): New function.
	(linux_target): Use it.
	(linux_trad_target): New function.
	* linux-nat.h (linux_trad_target): Declare.

	* alpha-linux-nat.c: Include "gdbcore.h".
	(alpha_linux_register_u_offset): New function.
	(_initialize_alpha_linux_nat): Use linux_trad_target.

	* mips-linux-nat.c: Include "gdbcore.h".
	(mips_linux_register_u_offset): New function.
	(_initialize_mips_linux_nat): Use linux_trad_target.

	* config/arm/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/arm/nm-linux.h: Delete file.

	* config/i386/nm-linux64.h (FETCH_INFERIOR_REGISTERS): Remove.
	* config/i386/nm-linux.h (FETCH_INFERIOR_REGISTERS): Remove.

	* config/ia64/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/ia64/nm-linux.h: Delete file.

	* config/m32r/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/m32r/nm-linux.h: Delete file.

	* config/m68k/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/m68k/nm-linux.h: Delete file.

	* config/pa/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/pa/nm-linux.h: Delete file.

	* config/powerpc/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/powerpc/ppc64-linux.mh (NAT_FILE): Likewise.
	* config/powerpc/nm-linux.h: Delete file.

	* config/s390/s390.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/s390/nm-linux.h: Delete file.

	* config/sparc/linux.mh (NAT_FILE): Set to config/nm-linux.h.
	* config/sparc/linux64.mh (NAT_FILE): Likewise.
	* config/sparc/nm-linux.h: Delete file.

	* Makefile.in (alpha-linux-nat.o): Update dependencies.
	(mips-linux-nat.o): Likewise.
This commit is contained in:
Ulrich Weigand
2007-04-25 22:17:48 +00:00
parent de732108dd
commit 910122bf0a
26 changed files with 113 additions and 287 deletions

View File

@@ -3164,35 +3164,12 @@ linux_xfer_partial (struct target_ops *ops, enum target_object object,
offset, len);
}
#ifndef FETCH_INFERIOR_REGISTERS
/* Return the address in the core dump or inferior of register
REGNO. */
static CORE_ADDR
linux_register_u_offset (int regno)
{
/* FIXME drow/2005-09-04: The hardcoded use of register_addr should go
away. This requires disentangling the various definitions of it
(particularly alpha-nat.c's). */
return register_addr (regno, 0);
}
#endif
/* Create a prototype generic Linux target. The client can override
it with local methods. */
struct target_ops *
linux_target (void)
static void
linux_target_install_ops (struct target_ops *t)
{
struct target_ops *t;
#ifdef FETCH_INFERIOR_REGISTERS
t = inf_ptrace_target ();
#else
t = inf_ptrace_trad_target (linux_register_u_offset);
#endif
t->to_insert_fork_catchpoint = child_insert_fork_catchpoint;
t->to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
t->to_insert_exec_catchpoint = child_insert_exec_catchpoint;
@@ -3205,6 +3182,26 @@ linux_target (void)
super_xfer_partial = t->to_xfer_partial;
t->to_xfer_partial = linux_xfer_partial;
}
struct target_ops *
linux_target (void)
{
struct target_ops *t;
t = inf_ptrace_target ();
linux_target_install_ops (t);
return t;
}
struct target_ops *
linux_trad_target (CORE_ADDR (*register_u_offset)(int))
{
struct target_ops *t;
t = inf_ptrace_trad_target (register_u_offset);
linux_target_install_ops (t);
return t;
}