diff options
author | John Baldwin <jhb@FreeBSD.org> | 2017-08-09 15:24:46 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2017-08-09 15:24:46 -0700 |
commit | 142311d325b962730f7d0247cc456f06e5c7b62b (patch) | |
tree | 1f9946e07b0268ea2b90c6583d84b9b5a5c55df2 /gdb/fbsd-nat.c | |
parent | 978c05401b0f0ac7a94cca7db19b1dec0c5bd698 (diff) | |
download | gdb-142311d325b962730f7d0247cc456f06e5c7b62b.zip gdb-142311d325b962730f7d0247cc456f06e5c7b62b.tar.gz gdb-142311d325b962730f7d0247cc456f06e5c7b62b.tar.bz2 |
Fix compile in the !HAVE_KINFO_GETVMMAP case.
gdb/ChangeLog:
* fbsd-nat.c: [!HAVE_KINFO_GETVMMAP]: Include <sys/user.h> and
"filestuff.h".
(fbsd_find_memory_regions): Fix `mapfile' initialization.
Diffstat (limited to 'gdb/fbsd-nat.c')
-rw-r--r-- | gdb/fbsd-nat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 833f460..3d3aa3d 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -30,9 +30,11 @@ #include <sys/ptrace.h> #include <sys/signal.h> #include <sys/sysctl.h> -#ifdef HAVE_KINFO_GETVMMAP #include <sys/user.h> +#ifdef HAVE_KINFO_GETVMMAP #include <libutil.h> +#else +#include "filestuff.h" #endif #include "elf-bfd.h" @@ -168,7 +170,7 @@ fbsd_find_memory_regions (struct target_ops *self, mapfilename = xstrprintf ("/proc/%ld/map", (long) pid); cleanup = make_cleanup (xfree, mapfilename); - gdb_file_up mapfile = fopen (mapfilename, "r"); + gdb_file_up mapfile (fopen (mapfilename, "r")); if (mapfile == NULL) error (_("Couldn't open %s."), mapfilename); |