aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-06-27 13:19:09 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2016-07-01 07:00:38 -0700
commita3405d124e1388b613a35af49f19f0cc1b8d959d (patch)
treee12adad3ac9eb9de413f8b570c89bef61ebbeaa4 /gdb/config
parent98a4fc78f9dab76b5ada3551a7bef36db8a3ed05 (diff)
downloadgdb-a3405d124e1388b613a35af49f19f0cc1b8d959d.zip
gdb-a3405d124e1388b613a35af49f19f0cc1b8d959d.tar.gz
gdb-a3405d124e1388b613a35af49f19f0cc1b8d959d.tar.bz2
Consolidate x86 debug register code for BSD native targets.
Move the debug register support code from amd64bsd-nat.c and i386bsd-nat.c into a shared x86bsd-nat.c. Instead of setting up x86_dr_low in amd64fbsd-nat.c and i386fbsd-nat.c, add a x86bsd_target function that creates a new target that inherits from inf_ptrace and sets up x86 debug registers if supported. In addition to initializing x86_dr_low, the x86bsd target installs a custom mourn_inferior target operation to clean up the x86 debug register state. Previously this was only done on amd64. Now it will be done for both i386 and amd64. The i386bsd_target and amd64bsd_target functions create targets that inherit from x86bsd rather than inf_ptrace. gdb/ChangeLog: * Makefile.in [HFILES_NO_SRCDIR]: Replace 'amd64bsd-nat.h' with 'x86bsd-nat.h'. * amd64bsd-nat.c: Include 'x86bsd-nat.h' instead of 'amd64bsd-nat.h'. (amd64bsd_xsave_len): Rename and move to x86bsd-nat.c. (amd64bsd_fetch_inferior_registers): Replace 'amd64bsd_xsave_len' with 'x86bsd_xsave_len'. (amd64bsd_store_inferior_registers): Likewise. (amd64bsd_target): Inherit from x86bsd_target. (amd64bsd_dr_get): Rename and move to x86bsd-nat.c. (amd64bsd_dr_set): Likewise. (amd64bsd_dr_set_control): Likewise. (amd64bsd_dr_set_addr): Likewise. (amd64bsd_dr_get_addr): Likewise. (amd64bsd_dr_get_status): Likewise. (amd64bsd_dr_get_control): Likewise. * amd64fbsd-nat.c: Include 'x86bsd-nat.h' instead of 'amd64bsd-nat.h'. (super_mourn_inferior): Move to x86bsd-nat.c. (amd64fbsd_mourn_inferior): Rename and move to x86bsd-nat.c. (amd64fbsd_read_description): Replace 'amd64bsd_xsave_len' with 'x86bsd_xsave_len'. (_initialize_amd64fbsd_nat): Remove x86 watchpoint setup and mourn_inferior' target op. * config/i386/fbsd.mh (NATDEPFILES): Add x86bsd-nat.o. * config/i386/fbsd64.mh: Likewise. * config/i386/nbsd64.mh: Likewise. * config/i386/nbsdelf.mh: Likewise. * config/i386/obsd.mh: Likewise. * config/i386/obsd64.mh: Likewise. * i386bsd-nat.c: Include 'x86bsd-nat.h'. (i386bsd_xsave_len): Rename and move to x86bsd-nat.c. (i386bsd_fetch_inferior_registers): Replace 'i386bsd_xsave_len' with 'x86bsd_xsave_len'. (i386bsd_store_inferior_registers): Likewise. (i386bsd_target): Inherit from x86bsd_target. (i386bsd_dr_get): Rename and move to x86bsd-nat.c. (i386bsd_dr_set): Likewise. (i386bsd_dr_set_control): Likewise. (i386bsd_dr_set_addr): Likewise. (i386bsd_dr_get_addr): Likewise. (i386bsd_dr_get_status): Likewise. (i386bsd_dr_get_control): Likewise. * i386bsd-nat.h (i386bsd_xsave_len): Remove. (i386bsd_dr_set_control): Remove. (i386bsd_dr_set_addr): Remove. (i386bsd_dr_get_addr): Remove. (i386bsd_dr_get_status): Remove. (i386bsd_dr_get_control): Remove. * i386fbsd-nat.c: Include 'x86bsd-nat.h'. (i386fbsd_read_description): Replace 'i386bsd_xsave_len' with 'x86bsd_xsave_len'. (_initialize_i386fbsd_nat): Remove x86 watchpoint setup and mourn_inferior' target op. * x86bsd-nat.c: New file. * x86bsd-nat.h: New file.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/i386/fbsd.mh4
-rw-r--r--gdb/config/i386/fbsd64.mh2
-rw-r--r--gdb/config/i386/nbsd64.mh2
-rw-r--r--gdb/config/i386/nbsdelf.mh2
-rw-r--r--gdb/config/i386/obsd.mh2
-rw-r--r--gdb/config/i386/obsd64.mh2
6 files changed, 7 insertions, 7 deletions
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
index e5bff3a..1db6660 100644
--- a/gdb/config/i386/fbsd.mh
+++ b/gdb/config/i386/fbsd.mh
@@ -1,7 +1,7 @@
# Host: FreeBSD/i386
NATDEPFILES= fork-child.o inf-ptrace.o \
- fbsd-nat.o x86-nat.o x86-dregs.o i386bsd-nat.o i386fbsd-nat.o \
- bsd-kvm.o
+ fbsd-nat.o x86-nat.o x86-dregs.o x86bsd-nat.o i386bsd-nat.o \
+ i386fbsd-nat.o bsd-kvm.o
NAT_FILE= nm-fbsd.h
HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
index 329c526..e196c00 100644
--- a/gdb/config/i386/fbsd64.mh
+++ b/gdb/config/i386/fbsd64.mh
@@ -1,7 +1,7 @@
# Host: FreeBSD/amd64
NATDEPFILES= fork-child.o inf-ptrace.o \
fbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
- bsd-kvm.o x86-nat.o x86-dregs.o
+ bsd-kvm.o x86-nat.o x86-dregs.o x86bsd-nat.o
HAVE_NATIVE_GCORE_HOST = 1
LOADLIBES= -lkvm
diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
index 5de8cf5..5fa369f 100644
--- a/gdb/config/i386/nbsd64.mh
+++ b/gdb/config/i386/nbsd64.mh
@@ -1,3 +1,3 @@
# Host: NetBSD/amd64
NATDEPFILES= fork-child.o inf-ptrace.o \
- nbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
+ nbsd-nat.o amd64-nat.o x86bsd-nat.o amd64bsd-nat.o amd64nbsd-nat.o
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
index d27c842..f8b9d6c 100644
--- a/gdb/config/i386/nbsdelf.mh
+++ b/gdb/config/i386/nbsdelf.mh
@@ -1,5 +1,5 @@
# Host: NetBSD/i386 ELF
NATDEPFILES= fork-child.o inf-ptrace.o \
- nbsd-nat.o i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
+ nbsd-nat.o x86bsd-nat.o i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
LOADLIBES= -lkvm
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
index a9041f4..3845d26 100644
--- a/gdb/config/i386/obsd.mh
+++ b/gdb/config/i386/obsd.mh
@@ -1,5 +1,5 @@
# Host: OpenBSD/i386 ELF
NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
- i386bsd-nat.o i386obsd-nat.o bsd-kvm.o
+ x86bsd-nat.o i386bsd-nat.o i386obsd-nat.o bsd-kvm.o
LOADLIBES= -lkvm
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
index 386a582..2a8c42c 100644
--- a/gdb/config/i386/obsd64.mh
+++ b/gdb/config/i386/obsd64.mh
@@ -1,5 +1,5 @@
# Host: OpenBSD/amd64
NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
- amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
+ amd64-nat.o x86bsd-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
LOADLIBES= -lkvm