aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat-trad.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-05-03 00:37:08 +0100
committerPedro Alves <palves@redhat.com>2018-05-03 00:47:32 +0100
commit6798487f5bc66ab9c34ad81fa28ba25d32a00bd9 (patch)
treec00684a6416a30046fbac93bd26860e18fd9a1a0 /gdb/linux-nat-trad.h
parentc1955e179201e76330a10c400bfa92cab2afbee0 (diff)
downloadgdb-6798487f5bc66ab9c34ad81fa28ba25d32a00bd9.zip
gdb-6798487f5bc66ab9c34ad81fa28ba25d32a00bd9.tar.gz
gdb-6798487f5bc66ab9c34ad81fa28ba25d32a00bd9.tar.bz2
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 <palves@redhat.com> * 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".
Diffstat (limited to 'gdb/linux-nat-trad.h')
-rw-r--r--gdb/linux-nat-trad.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/linux-nat-trad.h b/gdb/linux-nat-trad.h
new file mode 100644
index 0000000..3b4a6c8
--- /dev/null
+++ b/gdb/linux-nat-trad.h
@@ -0,0 +1,30 @@
+/* Generic GNU/Linux target using traditional ptrace register access.
+
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef LINUX_NAT_TRAD_H
+#define LINUX_NAT_TRAD_H
+
+#include "linux-nat.h"
+
+/* Create a generic GNU/Linux target using traditional
+ ptrace register access. */
+struct target_ops *linux_trad_target
+ (CORE_ADDR (*register_u_offset)(struct gdbarch *, int, int));
+
+#endif /* LINUX_NAT_TRAD_H */