aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-09-16 11:40:05 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2020-09-16 11:40:05 -0700
commite911c6663bb8cff9e6968a885b81d5dd484de031 (patch)
tree57b7386b1444d9a498ff26af28c48d2feae723c7 /gdbsupport
parent1f17d372496e18f93cad8ccec15d83530e41206f (diff)
downloadgdb-e911c6663bb8cff9e6968a885b81d5dd484de031.zip
gdb-e911c6663bb8cff9e6968a885b81d5dd484de031.tar.gz
gdb-e911c6663bb8cff9e6968a885b81d5dd484de031.tar.bz2
Require kinfo_get_file and kinfo_get_vmmap for FreeBSD hosts.
FreeBSD systems have provided these functions in libutil since 7.1 release. The most recent release without support is 6.4 released in November of 2008. This also requires libutil-freebsd on GNU/kFreeBSD systems. I assume that those systems have supported kinfo_get_file and kinfo_get_vmmap over a similar timeframe. gdb/ChangeLog: * configure.ac: Remove check for kinfo_getvmmap(). * configure, config.in: Regenerate. * fbsd-nat.c (fbsd_read_mapping): Remove (fbsd_nat_target::find_memory_regions): Remove the procfs version. (fbsd_nat_target::info_proc): Assume kinfo_getfile() and kinfo_get_vmmap() are always present. gdbsupport/ChangeLog: * common.m4 (GDB_AC_COMMON): Refactor checks for kinfo_getfile(). * configure, config.in: Regenerate.
Diffstat (limited to 'gdbsupport')
-rw-r--r--gdbsupport/ChangeLog5
-rw-r--r--gdbsupport/common.m410
-rw-r--r--gdbsupport/config.in2
-rwxr-xr-xgdbsupport/configure16
4 files changed, 28 insertions, 5 deletions
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index 2c35ee7..d46f8c7 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-16 John Baldwin <jhb@FreeBSD.org>
+
+ * common.m4 (GDB_AC_COMMON): Refactor checks for kinfo_getfile().
+ * configure, config.in: Regenerate.
+
2020-09-14 Pedro Alves <pedro@palves.net>
* enum-flags.h: Include "traits.h".
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index e8fd64c..2b5750e 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -86,9 +86,13 @@ AC_DEFUN([GDB_AC_COMMON], [
AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
- AC_SEARCH_LIBS(kinfo_getfile, util util-freebsd,
- [AC_DEFINE(HAVE_KINFO_GETFILE, 1,
- [Define to 1 if your system has the kinfo_getfile function. ])])
+ # On FreeBSD we need libutil for the kinfo_get* functions. On
+ # GNU/kFreeBSD systems, FreeBSD libutil is renamed to libutil-freebsd.
+ # Figure out which one to use.
+ AC_SEARCH_LIBS(kinfo_getfile, util util-freebsd)
+
+ # Define HAVE_KINFO_GETFILE if kinfo_getfile is available.
+ AC_CHECK_FUNCS(kinfo_getfile)
# Check for std::thread. This does not work on some platforms, like
# mingw and DJGPP.
diff --git a/gdbsupport/config.in b/gdbsupport/config.in
index 973561b..ecc6fa5 100644
--- a/gdbsupport/config.in
+++ b/gdbsupport/config.in
@@ -112,7 +112,7 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define to 1 if your system has the kinfo_getfile function. */
+/* Define to 1 if you have the `kinfo_getfile' function. */
#undef HAVE_KINFO_GETFILE
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
diff --git a/gdbsupport/configure b/gdbsupport/configure
index bd95b6d..a37f3c2 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -8976,6 +8976,9 @@ _ACEOF
fi
+ # On FreeBSD we need libutil for the kinfo_get* functions. On
+ # GNU/kFreeBSD systems, FreeBSD libutil is renamed to libutil-freebsd.
+ # Figure out which one to use.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kinfo_getfile" >&5
$as_echo_n "checking for library containing kinfo_getfile... " >&6; }
if ${ac_cv_search_kinfo_getfile+:} false; then :
@@ -9030,9 +9033,20 @@ ac_res=$ac_cv_search_kinfo_getfile
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-$as_echo "#define HAVE_KINFO_GETFILE 1" >>confdefs.h
+fi
+
+
+ # Define HAVE_KINFO_GETFILE if kinfo_getfile is available.
+ for ac_func in kinfo_getfile
+do :
+ ac_fn_c_check_func "$LINENO" "kinfo_getfile" "ac_cv_func_kinfo_getfile"
+if test "x$ac_cv_func_kinfo_getfile" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KINFO_GETFILE 1
+_ACEOF
fi
+done
# Check for std::thread. This does not work on some platforms, like