aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-linux-nat.h
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-07-10 15:43:56 +0100
committerGary Benson <gbenson@redhat.com>2014-07-11 12:24:26 +0100
commit040baaf6deeec9f92645169f3f6e84996e23c986 (patch)
treeaa2ae994423c1541b82fd48d1fc6c8ef16d0567e /gdb/x86-linux-nat.h
parent1aa7e42c3f5c5295f81ff94301c642642be86395 (diff)
downloadgdb-040baaf6deeec9f92645169f3f6e84996e23c986.zip
gdb-040baaf6deeec9f92645169f3f6e84996e23c986.tar.gz
gdb-040baaf6deeec9f92645169f3f6e84996e23c986.tar.bz2
Move duplicated code into new files
This commit moves the duplicated code in {i386,amd64}-linux-nat.c into the new files x86-linux-nat.[ch]. Additionally, a new file i386-linux-nat.h was required to expose a value required by the 32-bit code in x86-linux-nat.c. gdb/ 2014-07-11 Gary Benson <gbenson@redhat.com> * i386-linux-nat.h: New file. * x86-linux-nat.h: Likewise. * x86-linux-nat.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add the above new headers. * config/i386/linux.mh (NATDEPFILES): Add x86-linux-nat.o. * config/i386/linux64.mh (NATDEPFILES): Likewise. * amd64-linux-nat.c (x86-linux-nat.h): New include. (PTRACE_GETREGSET): Now in x86-linux-nat.h. (PTRACE_SETREGSET): Likewise. (arch_lwp_info): Now in x86-linux-nat.c. (have_ptrace_getregset): Now in x86-linux-nat.h. (x86_linux_dr_get): Now in x86-linux-nat.c. (x86_linux_dr_set): Likewise. (x86_linux_dr_get_addr): Likewise. (x86_linux_dr_get_control): Likewise. (x86_linux_dr_get_status): Likewise. (update_debug_registers_callback): Likewise. (x86_linux_dr_set_control): Likewise. (x86_linux_dr_set_addr): Likewise. (x86_linux_prepare_to_resume): Likewise. (x86_linux_new_thread): Likewise. (x86_linux_new_fork): Likewise. (x86_linux_get_thread_area): Likewise. (super_post_startup_inferior): Likewise. (x86_linux_child_post_startup_inferior): Likewise. (AMD64_LINUX_USER64_CS): Likewise. (AMD64_LINUX_X32_DS): Likewise. (x86_linux_read_description): Likewise. (x86_linux_enable_btrace): Likewise. (x86_linux_disable_btrace): Likewise. (x86_linux_teardown_btrace): Likewise. (x86_linux_read_btrace): Likewise. (x86_linux_create_target): Likewise. (x86_linux_add_target): Likewise. * i386-linux-nat.c (x86-linux-nat.h): New include. (PTRACE_GETREGSET): Now in x86-linux-nat.h. (PTRACE_SETREGSET): Likewise. (arch_lwp_info): Now in x86-linux-nat.c. (have_ptrace_getregset): Now in x86-linux-nat.h. (x86_linux_dr_get): Now in x86-linux-nat.c. (x86_linux_dr_set): Likewise. (x86_linux_dr_get_addr): Likewise. (x86_linux_dr_get_control): Likewise. (x86_linux_dr_get_status): Likewise. (update_debug_registers_callback): Likewise. (x86_linux_dr_set_control): Likewise. (x86_linux_dr_set_addr): Likewise. (x86_linux_prepare_to_resume): Likewise. (x86_linux_new_thread): Likewise. (x86_linux_new_fork): Likewise. (x86_linux_get_thread_area): Likewise. (super_post_startup_inferior): Likewise. (x86_linux_child_post_startup_inferior): Likewise. (AMD64_LINUX_USER64_CS): Likewise. (AMD64_LINUX_X32_DS): Likewise. (x86_linux_read_description): Likewise. (x86_linux_enable_btrace): Likewise. (x86_linux_disable_btrace): Likewise. (x86_linux_teardown_btrace): Likewise. (x86_linux_read_btrace): Likewise. (x86_linux_create_target): Likewise. (x86_linux_add_target): Likewise.
Diffstat (limited to 'gdb/x86-linux-nat.h')
-rw-r--r--gdb/x86-linux-nat.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/x86-linux-nat.h b/gdb/x86-linux-nat.h
new file mode 100644
index 0000000..16679af
--- /dev/null
+++ b/gdb/x86-linux-nat.h
@@ -0,0 +1,51 @@
+/* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
+
+ Copyright (C) 1999-2014 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 X86_LINUX_NAT_H
+#define X86_LINUX_NAT_H 1
+
+#ifndef PTRACE_GETREGSET
+#define PTRACE_GETREGSET 0x4204
+#endif
+
+#ifndef PTRACE_SETREGSET
+#define PTRACE_SETREGSET 0x4205
+#endif
+
+/* Does the current host support PTRACE_GETREGSET? */
+extern int have_ptrace_getregset;
+
+
+/* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to
+ the thread local storage (or its descriptor) and returns PS_OK
+ on success. Returns PS_ERR on failure. */
+
+extern ps_err_e x86_linux_get_thread_area (pid_t pid, void *addr,
+ unsigned int *base_addr);
+
+
+/* Create an x86 GNU/Linux target. */
+
+extern struct target_ops *x86_linux_create_target (void);
+
+/* Add an x86 GNU/Linux target. */
+
+extern void x86_linux_add_target (struct target_ops *t);
+
+#endif