This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Define _KMEMUSER before including BSD kernel headers.
- From: John Baldwin <jhb at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 5 Sep 2017 02:43:27 -0000
- Subject: [binutils-gdb] Define _KMEMUSER before including BSD kernel headers.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c49fbc6c79e0c479371e0ba7be0c8d1137016864
commit c49fbc6c79e0c479371e0ba7be0c8d1137016864
Author: John Baldwin <jhb@FreeBSD.org>
Date: Mon Sep 4 19:34:48 2017 -0700
Define _KMEMUSER before including BSD kernel headers.
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.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/bsd-kvm.c | 1 +
gdb/configure | 1 +
gdb/configure.ac | 1 +
4 files changed, 9 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 74b5d8f..0d86e47 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2017-09-04 John Baldwin <jhb@FreeBSD.org>
+ * bsd-kvm.o: Define _KMEMUSER.
+ * configure.ac: Define _KMEMUSER when checking for "struct lwp".
+ * configure: Regenerate.
+
+2017-09-04 John Baldwin <jhb@FreeBSD.org>
+
* amd64-fbsd-nat.c: Add include of "x86-xstate.h".
* i386-fbsd-nat.c: Likewise.
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 98e2428..8c21394 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -17,6 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define _KMEMUSER
#include "defs.h"
#include "cli/cli-cmds.h"
#include "command.h"
diff --git a/gdb/configure b/gdb/configure
index 755e3dc..c7746fc 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -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 ()
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 10d2d10..b4d7a87 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -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