[2/4] Define _KMEMUSER before including BSD kernel headers.
Commit Message
Recent versions of NetBSD hide certain kernel structures needed by the
KVM target from userland unless this macro is defined.
gdb/ChangeLog:
* bsd-kvm.o: Define _KMEMUSER.
* configure.ac: Define _KMEMUSER when checking for "struct lwp".
* configure: Regenerate.
---
gdb/ChangeLog | 6 ++++++
gdb/bsd-kvm.c | 1 +
gdb/configure | 1 +
gdb/configure.ac | 1 +
4 files changed, 9 insertions(+)
@@ -1,5 +1,11 @@
2017-07-15 John Baldwin <jhb@FreeBSD.org>
+ * bsd-kvm.o: Define _KMEMUSER.
+ * configure.ac: Define _KMEMUSER when checking for "struct lwp".
+ * configure: Regenerate.
+
+2017-07-15 John Baldwin <jhb@FreeBSD.org>
+
* configure.nat: Add "-lkvm" for NetBSD/sparc64 and fix typo.
2017-07-14 Tom Tromey <tom@tromey.com>
@@ -27,6 +27,7 @@
#include "gdbcore.h" /* for get_exec_file */
#include "gdbthread.h"
+#define _KMEMUSER
#include <fcntl.h>
#include <kvm.h>
#ifdef HAVE_NLIST_H
@@ -13571,6 +13571,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/param.h>
+#define _KMEMUSER
#include <sys/lwp.h>
int
main ()
@@ -1434,6 +1434,7 @@ AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
# See if <sys/lwp.h> defines `struct lwp`.
AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
[AC_TRY_COMPILE([#include <sys/param.h>
+#define _KMEMUSER
#include <sys/lwp.h>], [struct lwp l;],
gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)])
if test $gdb_cv_struct_lwp = yes; then