From 6798487f5bc66ab9c34ad81fa28ba25d32a00bd9 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 3 May 2018 00:37:08 +0100 Subject: Make inf_ptrace_trad Linux-only, move to separate file There are only two inf_ptrace_trad_target users, MIPS GNU/Linux and Alpha GNU/Linux. They both call it via linux_trad_target. Move this code out of inf-ptrace.c to a GNU/Linux-specific new file. Making this code be GNU/Linux-specific simplifies C++ification of target_ops, because we can make the trad target inherit linux_nat instead of inheriting inf_ptrace. That'll be visible in a later patch. Note this makes linux_target_install_ops an extern function, but that is temporary -- the function will disappear once target_ops is made a C++ class with virtual methods, later in the series. Also, I did not rename the functions in the new file for a similar reason. They'll be renamed again anyway in a couple of patches. gdb/ChangeLog: 2018-05-02 Pedro Alves * alpha-linux-nat.c: Include "linux-nat-trad.h" instead of "linux-nat.h". * configure.nat (alpha-linux, linux-mips): Add linux-nat-trad.o. * inf-ptrace.c (inf_ptrace_register_u_offset) (inf_ptrace_fetch_register, inf_ptrace_fetch_registers) (inf_ptrace_store_register, inf_ptrace_store_registers) (inf_ptrace_trad_target): Move to ... * linux-nat-trad.c: ... this new file. * linux-nat-trad.h: New file. * linux-nat.c (linux_target_install_ops): Make extern. (linux_trad_target): Delete. * linux-nat.h (linux_trad_target): Delete declaration. (linux_target_install_ops): Declare. * mips-linux-nat.c: Include "linux-nat-trad.h" instead of "linux-nat.h". --- gdb/mips-linux-nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/mips-linux-nat.c') diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index 68fd1f8..17e70b6 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -24,7 +24,7 @@ #include "mips-tdep.h" #include "target.h" #include "regcache.h" -#include "linux-nat.h" +#include "linux-nat-trad.h" #include "mips-linux-tdep.h" #include "target-descriptions.h" -- cgit v1.1