[llvm-commits] [compiler-rt] r151147 - in /compiler-rt/trunk/lib/asan: asan_internal.h asan_posix.cc asan_procmaps.h asan_rtl.cc asan_win.cc
Alexander Potapenko
glider at google.com
Wed Feb 22 01:11:55 PST 2012
Author: glider
Date: Wed Feb 22 03:11:55 2012
New Revision: 151147
URL: http://llvm.org/viewvc/llvm-project?rev=151147&view=rev
Log:
Move the contents of AsanProcMaps::Dump() into AsanDumpProcessMaps() for Posix systems.
Define AsanDumpProcessMaps as unimplemented on Windows.
This should fix the Windows build.
Modified:
compiler-rt/trunk/lib/asan/asan_internal.h
compiler-rt/trunk/lib/asan/asan_posix.cc
compiler-rt/trunk/lib/asan/asan_procmaps.h
compiler-rt/trunk/lib/asan/asan_rtl.cc
compiler-rt/trunk/lib/asan/asan_win.cc
Modified: compiler-rt/trunk/lib/asan/asan_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_internal.h?rev=151147&r1=151146&r2=151147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_internal.h (original)
+++ compiler-rt/trunk/lib/asan/asan_internal.h Wed Feb 22 03:11:55 2012
@@ -130,6 +130,7 @@
bool AsanShadowRangeIsAvailable();
int AsanOpenReadonly(const char* filename);
const char *AsanGetEnv(const char *name);
+void AsanDumpProcessMap();
void *AsanMmapFixedNoReserve(uintptr_t fixed_addr, size_t size);
void *AsanMmapFixedReserve(uintptr_t fixed_addr, size_t size);
Modified: compiler-rt/trunk/lib/asan/asan_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_posix.cc?rev=151147&r1=151146&r2=151147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_posix.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_posix.cc Wed Feb 22 03:11:55 2012
@@ -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();
}
Modified: compiler-rt/trunk/lib/asan/asan_procmaps.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_procmaps.h?rev=151147&r1=151146&r2=151147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_procmaps.h (original)
+++ compiler-rt/trunk/lib/asan/asan_procmaps.h Wed Feb 22 03:11:55 2012
@@ -28,19 +28,6 @@
// address 'addr'. Returns true on success.
bool GetObjectNameAndOffset(uintptr_t addr, uintptr_t *offset,
char filename[], size_t filename_size);
- void Dump() {
- Reset();
- uintptr_t start, end;
- const intptr_t kBufSize = 4095;
- char filename[kBufSize];
- Report("Process memory map follows:\n");
- while (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");
- }
-
~AsanProcMaps();
private:
// Default implementation of GetObjectNameAndOffset.
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=151147&r1=151146&r2=151147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed Feb 22 03:11:55 2012
@@ -17,7 +17,6 @@
#include "asan_internal.h"
#include "asan_lock.h"
#include "asan_mapping.h"
-#include "asan_procmaps.h"
#include "asan_stack.h"
#include "asan_stats.h"
#include "asan_thread.h"
@@ -490,8 +489,7 @@
} else {
Report("Shadow memory range interleaves with an existing memory mapping. "
"ASan cannot proceed correctly. ABORTING.\n");
- AsanProcMaps proc_maps;
- proc_maps.Dump();
+ AsanDumpProcessMap();
AsanDie();
}
Modified: compiler-rt/trunk/lib/asan/asan_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_win.cc?rev=151147&r1=151146&r2=151147&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_win.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_win.cc Wed Feb 22 03:11:55 2012
@@ -232,6 +232,10 @@
return NULL;
}
+void AsanDumpProcessMap() {
+ UNIMPLEMENTED();
+}
+
int GetPid() {
return GetProcessId(GetCurrentProcess());
}
More information about the llvm-commits
mailing list