diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/configure.nat | 8 | ||||
-rw-r--r-- | gdb/x86-bsd-nat.c | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ed89fbc..de1945a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-09-04 John Baldwin <jhb@FreeBSD.org> + * configure.nat: Add "x86-nat.o x86-dregs.o" for NetBSD/amd64 and + NetBSD/i386. + * x86-bsd-nat.c [!DBREG_DRX && __NetBSD__]: Define DBREG_DRX. + +2017-09-04 John Baldwin <jhb@FreeBSD.org> + * bsd-kvm.o: Make <sys/user.h> conditional on HAVE_SYS_USER_H. 2017-09-04 John Baldwin <jhb@FreeBSD.org> diff --git a/gdb/configure.nat b/gdb/configure.nat index b32c9aa..b1dda30 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat @@ -338,8 +338,8 @@ case ${gdb_host} in case ${gdb_host_cpu} in i386) # Host: NetBSD/amd64 - NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o \ - x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o" + NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o x86-nat.o \ + x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o" ;; sparc) # Host: NetBSD/sparc64 @@ -358,8 +358,8 @@ case ${gdb_host} in ;; i386) # Host: NetBSD/i386 ELF - NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-bsd-nat.o \ - i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o" + NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-nat.o x86-dregs.o \ + x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o" LOADLIBES='-lkvm' ;; m68k) diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c index 2ff661c..1d37b2f 100644 --- a/gdb/x86-bsd-nat.c +++ b/gdb/x86-bsd-nat.c @@ -51,11 +51,16 @@ x86bsd_mourn_inferior (struct target_ops *ops) super_mourn_inferior (ops); } -/* Not all versions of FreeBSD/i386 that support the debug registers - have this macro. */ +/* Helper macro to access debug register X. FreeBSD/amd64 and modern + versions of FreeBSD/i386 provide this macro in system headers. Define + a local version for systems that do not provide it. */ #ifndef DBREG_DRX +#ifdef __NetBSD__ +#define DBREG_DRX(d, x) ((d)->dr[x]) +#else #define DBREG_DRX(d, x) ((&d->dr0)[x]) #endif +#endif static unsigned long x86bsd_dr_get (ptid_t ptid, int regnum) |