Fix compile in the !HAVE_KINFO_GETVMMAP case.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 9 Aug 2017 22:24:46 +0000 (15:24 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 9 Aug 2017 22:24:46 +0000 (15:24 -0700)
gdb/ChangeLog:

* fbsd-nat.c: [!HAVE_KINFO_GETVMMAP]: Include <sys/user.h> and
"filestuff.h".
(fbsd_find_memory_regions): Fix `mapfile' initialization.

gdb/ChangeLog
gdb/fbsd-nat.c

index 55a0b12d50f920af8eda6bdfeaac54d643f9fa74..aa2a48e609ac06054ca0fef8aca2961b1d31b0f6 100644 (file)
@@ -1,3 +1,9 @@
+2017-08-09  John Baldwin  <jhb@FreeBSD.org>
+
+       * fbsd-nat.c: [!HAVE_KINFO_GETVMMAP]: Include <sys/user.h> and
+       "filestuff.h".
+       (fbsd_find_memory_regions): Fix `mapfile' initialization.
+
 2017-08-09  Tom Tromey  <tom@tromey.com>
 
        * skip.c (skiplist_entry): New constructor.
index 833f460237fcf6acddd145e229b0bfa5f2c33886..3d3aa3df59fea40e3dc77f89837c28b213c6690a 100644 (file)
 #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);