summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/hwasan/hwasan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/hwasan/hwasan.cpp')
-rw-r--r--compiler-rt/lib/hwasan/hwasan.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp
index 03aa6c18078..efcb311e00e 100644
--- a/compiler-rt/lib/hwasan/hwasan.cpp
+++ b/compiler-rt/lib/hwasan/hwasan.cpp
@@ -144,26 +144,6 @@ static void InitializeFlags() {
if (common_flags()->help) parser.PrintFlagDescriptions();
}
-void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp,
- void *context, bool request_fast_unwind) {
- Thread *t = GetCurrentThread();
- if (!t) {
- // the thread is still being created.
- stack->size = 0;
- return;
- }
- if (!StackTrace::WillUseFastUnwind(request_fast_unwind)) {
- // Block reports from our interceptors during _Unwind_Backtrace.
- SymbolizerScope sym_scope;
- return stack->Unwind(max_s, pc, bp, context, 0, 0, request_fast_unwind);
- }
- if (StackTrace::WillUseFastUnwind(request_fast_unwind))
- stack->Unwind(max_s, pc, bp, nullptr, t->stack_top(), t->stack_bottom(),
- true);
- else
- stack->Unwind(max_s, pc, 0, context, 0, 0, false);
-}
-
static void HWAsanCheckFailed(const char *file, int line, const char *cond,
u64 v1, u64 v2) {
Report("HWAddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file,
@@ -264,6 +244,28 @@ void InitInstrumentation() {
} // namespace __hwasan
+void __sanitizer::GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc,
+ uptr bp, void *context,
+ bool request_fast_unwind) {
+ using namespace __hwasan;
+ Thread *t = GetCurrentThread();
+ if (!t) {
+ // the thread is still being created.
+ stack->size = 0;
+ return;
+ }
+ if (!StackTrace::WillUseFastUnwind(request_fast_unwind)) {
+ // Block reports from our interceptors during _Unwind_Backtrace.
+ SymbolizerScope sym_scope;
+ return stack->Unwind(max_s, pc, bp, context, 0, 0, request_fast_unwind);
+ }
+ if (StackTrace::WillUseFastUnwind(request_fast_unwind))
+ stack->Unwind(max_s, pc, bp, nullptr, t->stack_top(), t->stack_bottom(),
+ true);
+ else
+ stack->Unwind(max_s, pc, 0, context, 0, 0, false);
+}
+
// Interface.
using namespace __hwasan;
OpenPOWER on IntegriCloud