diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-07 06:33:06 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-07 06:33:06 +0000 |
commit | e74968cbb29c80073e4ff440555e35f3fbed2f20 (patch) | |
tree | 44f40a2f4f65292686ddf3148ed105a4aff9282d /lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc | |
parent | e041c6024b3ebf1365c0f99732fc69c607577571 (diff) | |
download | compiler-rt-e74968cbb29c80073e4ff440555e35f3fbed2f20.tar.gz compiler-rt-e74968cbb29c80073e4ff440555e35f3fbed2f20.tar.bz2 compiler-rt-e74968cbb29c80073e4ff440555e35f3fbed2f20.tar.xz |
[Sanitizer] Call Windows unwinder 'slow' and share StackTrace::Unwind across all platforms. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc b/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc new file mode 100644 index 00000000..8ce0918d --- /dev/null +++ b/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc @@ -0,0 +1,32 @@ +//===-- sanitizer_stacktrace_libcdep.cc -----------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is shared between AddressSanitizer and ThreadSanitizer +// run-time libraries. +//===----------------------------------------------------------------------===// + +#include "sanitizer_stacktrace.h" + +namespace __sanitizer { + +void StackTrace::Unwind(uptr max_depth, uptr pc, uptr bp, uptr stack_top, + uptr stack_bottom, bool fast) { + // Check if fast unwind is available. Fast unwind is the only option on Mac. + if (!SANITIZER_CAN_FAST_UNWIND) + fast = false; + else if (SANITIZER_MAC) + fast = true; + + if (!fast) + SlowUnwindStack(pc, max_depth); + else + FastUnwindStack(pc, bp, stack_top, stack_bottom, max_depth); +} + +} // namespace __sanitizer |