From patchwork Tue Jul 25 16:50:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 21757 Received: (qmail 77385 invoked by alias); 25 Jul 2017 16:51:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77155 invoked by uid 89); 25 Jul 2017 16:51:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=kvm, HX-Greylist:succeeded, HX-Greylist:SMTP, HX-Greylist:AUTH X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Jul 2017 16:51:29 +0000 Received: from ralph.baldwin.cx.net (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id B29D510AF01; Tue, 25 Jul 2017 12:51:27 -0400 (EDT) From: John Baldwin 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 09:50:50 -0700 Message-Id: <20170725165051.9132-2-jhb@FreeBSD.org> In-Reply-To: <20170725165051.9132-1-jhb@FreeBSD.org> References: <20170725165051.9132-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 + * bsd-kvm.o: Define _KMEMUSER. + * configure.ac: Define _KMEMUSER when checking for "struct lwp". + * configure: Regenerate. + +2017-07-25 John Baldwin + * configure.nat: Add "-lkvm" for NetBSD/sparc64 and fix typo. 2017-07-25 Yao Qi 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 . */ +#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 +#define _KMEMUSER #include 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 defines `struct lwp`. AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, [AC_TRY_COMPILE([#include +#define _KMEMUSER #include ], [struct lwp l;], gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)]) if test $gdb_cv_struct_lwp = yes; then