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.
This commit is contained in:
John Baldwin
2017-09-04 19:34:48 -07:00
parent 26562e73d8
commit c49fbc6c79
4 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
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".

View File

@@ -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"

1
gdb/configure vendored
View File

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

View File

@@ -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