summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-06-15 06:08:19 +0000
committerAlexey Samsonov <samsonov@google.com>2012-06-15 06:08:19 +0000
commitae1e171b72fe8edba49cb486f0c350bd165891dd (patch)
treee781af97c52f6d2b4bf6807453c254cba412da66 /compiler-rt/lib/asan
parent574cb4c2af3cc5159c4b94693c41f5c00ac1fe6f (diff)
downloadbcm5719-llvm-ae1e171b72fe8edba49cb486f0c350bd165891dd.tar.gz
bcm5719-llvm-ae1e171b72fe8edba49cb486f0c350bd165891dd.zip
[Sanitizer] move DumpProcessMap and DisableCoreDumper to common runtime
llvm-svn: 158490
Diffstat (limited to 'compiler-rt/lib/asan')
-rw-r--r--compiler-rt/lib/asan/asan_internal.h2
-rw-r--r--compiler-rt/lib/asan/asan_posix.cc20
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc4
-rw-r--r--compiler-rt/lib/asan/asan_win.cc8
4 files changed, 2 insertions, 32 deletions
diff --git a/compiler-rt/lib/asan/asan_internal.h b/compiler-rt/lib/asan/asan_internal.h
index b23a7d846e4..f2663f0cde8 100644
--- a/compiler-rt/lib/asan/asan_internal.h
+++ b/compiler-rt/lib/asan/asan_internal.h
@@ -122,9 +122,7 @@ void ReplaceSystemMalloc();
// asan_linux.cc / asan_mac.cc / asan_win.cc
void *AsanDoesNotSupportStaticLinkage();
bool AsanShadowRangeIsAvailable();
-void AsanDumpProcessMap();
-void AsanDisableCoreDumper();
void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp);
bool AsanInterceptsSignal(int signum);
diff --git a/compiler-rt/lib/asan/asan_posix.cc b/compiler-rt/lib/asan/asan_posix.cc
index 503f38f36b2..429f58a75e2 100644
--- a/compiler-rt/lib/asan/asan_posix.cc
+++ b/compiler-rt/lib/asan/asan_posix.cc
@@ -134,26 +134,6 @@ void InstallSignalHandlers() {
MaybeInstallSigaction(SIGBUS, ASAN_OnSIGSEGV);
}
-void AsanDisableCoreDumper() {
- struct rlimit nocore;
- nocore.rlim_cur = 0;
- nocore.rlim_max = 0;
- setrlimit(RLIMIT_CORE, &nocore);
-}
-
-void AsanDumpProcessMap() {
- ProcessMaps proc_maps;
- uptr start, end;
- const sptr kBufSize = 4095;
- char filename[kBufSize];
- Report("Process memory map follows:\n");
- while (proc_maps.Next(&start, &end, /* file_offset */0,
- filename, kBufSize)) {
- Printf("\t%p-%p\t%s\n", (void*)start, (void*)end, filename);
- }
- Report("End of process memory map.\n");
-}
-
uptr GetThreadSelf() {
return (uptr)pthread_self();
}
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index a1fbae32a8a..91ed9c97422 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -536,7 +536,7 @@ void __asan_init() {
}
if (FLAG_disable_core) {
- AsanDisableCoreDumper();
+ DisableCoreDumper();
}
if (AsanShadowRangeIsAvailable()) {
@@ -552,7 +552,7 @@ void __asan_init() {
} else {
Report("Shadow memory range interleaves with an existing memory mapping. "
"ASan cannot proceed correctly. ABORTING.\n");
- AsanDumpProcessMap();
+ DumpProcessMap();
Die();
}
diff --git a/compiler-rt/lib/asan/asan_win.cc b/compiler-rt/lib/asan/asan_win.cc
index e33f431b26d..b9034ca09be 100644
--- a/compiler-rt/lib/asan/asan_win.cc
+++ b/compiler-rt/lib/asan/asan_win.cc
@@ -192,10 +192,6 @@ u8 AtomicExchange(u8 *a, u8 new_val) {
return t;
}
-void AsanDumpProcessMap() {
- UNIMPLEMENTED();
-}
-
uptr GetThreadSelf() {
return GetCurrentThreadId();
}
@@ -212,10 +208,6 @@ void InstallSignalHandlers() {
// FIXME: Decide what to do on Windows.
}
-void AsanDisableCoreDumper() {
- UNIMPLEMENTED();
-}
-
void SleepForSeconds(int seconds) {
Sleep(seconds * 1000);
}
OpenPOWER on IntegriCloud