Move the contents of AsanProcMaps::Dump() into AsanDumpProcessMaps() for Posix systems.
Define AsanDumpProcessMaps as unimplemented on Windows.

This should fix the Windows build.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@151147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_posix.cc b/lib/asan/asan_posix.cc
index 1b8b7c2..a1f0ecd 100644
--- a/lib/asan/asan_posix.cc
+++ b/lib/asan/asan_posix.cc
@@ -15,6 +15,7 @@
 
 #include "asan_internal.h"
 #include "asan_interceptors.h"
+#include "asan_procmaps.h"
 #include "asan_stack.h"
 #include "asan_thread_registry.h"
 
@@ -69,6 +70,19 @@
   setrlimit(RLIMIT_CORE, &nocore);
 }
 
+void AsanDumpProcessMap() {
+  AsanProcMaps proc_maps;
+  uintptr_t start, end;
+  const intptr_t kBufSize = 4095;
+  char filename[kBufSize];
+  Report("Process memory map follows:\n");
+  while (proc_maps.Next(&start, &end, /* file_offset */NULL,
+                        filename, kBufSize)) {
+    Printf("\t%p-%p\t%s\n", (void*)start, (void*)end, filename);
+  }
+  Report("End of process memory map.\n");
+}
+
 int GetPid() {
   return getpid();
 }