Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org,	coypu@sdf.org
Subject: [PATCH v2 1/2] Define _KMEMUSER before including BSD kernel headers.
Date: Tue, 25 Jul 2017 16:51:00 -0000	[thread overview]
Message-ID: <20170725165051.9132-2-jhb@FreeBSD.org> (raw)
In-Reply-To: <20170725165051.9132-1-jhb@FreeBSD.org>

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(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b3f9c7b061..e06712d645 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2017-07-25  John Baldwin  <jhb@FreeBSD.org>
 
+	* bsd-kvm.o: Define _KMEMUSER.
+	* configure.ac: Define _KMEMUSER when checking for "struct lwp".
+	* configure: Regenerate.
+
+2017-07-25  John Baldwin  <jhb@FreeBSD.org>
+
 	* configure.nat: Add "-lkvm" for NetBSD/sparc64 and fix typo.
 
 2017-07-25  Yao Qi  <yao.qi@linaro.org>
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 98e242836d..8c2139462d 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 755e3dccf1..c7746fc60f 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 10d2d10b12..b4d7a87701 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
-- 
2.13.3


  parent reply	other threads:[~2017-07-25 16:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 16:51 [PATCH v2 0/2] Various build fixes for NetBSD John Baldwin
2017-07-25 16:51 ` [PATCH v2 2/2] Enable support for x86 debug registers on NetBSD John Baldwin
2017-07-25 16:51 ` John Baldwin [this message]
2017-09-04 12:50 ` [PATCH v2 0/2] Various build fixes for NetBSD Pedro Alves
2017-09-04 13:03   ` Kamil Rytarowski
2017-09-04 14:01     ` Pedro Alves
2017-09-04 14:34       ` Kamil Rytarowski
2017-09-04 17:08         ` John Baldwin
2017-09-04 13:27   ` John Baldwin
2017-09-04 20:04     ` coypu
2017-09-04 22:18       ` John Baldwin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170725165051.9132-2-jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=coypu@sdf.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox