This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/3] 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.
---
 gdb/ChangeLog  | 6 ++++++
 gdb/fbsd-nat.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c4ad2bf1eb..133fbaf3bd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-07  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-07  Maciej W. Rozycki  <macro@imgtec.com>
 
 	PR breakpoints/21886
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 833f460237..3d3aa3df59 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);
 
-- 
2.13.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]