1 //===-- ubsan_diag_standalone.cpp -----------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Diagnostic reporting for the standalone UBSan runtime.
11 //===----------------------------------------------------------------------===//
13 #include "ubsan_platform.h"
15 #include "ubsan_diag.h"
17 using namespace __ubsan
;
19 void __sanitizer::BufferedStackTrace::UnwindImpl(
20 uptr pc
, uptr bp
, void *context
, bool request_fast
, u32 max_depth
) {
23 GetThreadStackTopAndBottom(false, &top
, &bottom
);
24 bool fast
= StackTrace::WillUseFastUnwind(request_fast
);
25 Unwind(max_depth
, pc
, bp
, context
, top
, bottom
, fast
);
29 SANITIZER_INTERFACE_ATTRIBUTE
30 void __sanitizer_print_stack_trace() {
32 BufferedStackTrace stack
;
33 stack
.Unwind(pc
, bp
, nullptr, common_flags()->fast_unwind_on_fatal
);
38 #endif // CAN_SANITIZE_UB