| //===-- ubsan_diag_standalone.cpp -----------------------------------------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| // Diagnostic reporting for the standalone UBSan runtime. |
| //===----------------------------------------------------------------------===// |
| #include "ubsan_platform.h" |
| void __sanitizer::BufferedStackTrace::UnwindImpl( |
| uptr pc, uptr bp, void *context, bool request_fast, u32 max_depth) { |
| GetThreadStackTopAndBottom(false, &top, &bottom); |
| bool fast = StackTrace::WillUseFastUnwind(request_fast); |
| Unwind(max_depth, pc, bp, context, top, bottom, fast); |
| SANITIZER_INTERFACE_ATTRIBUTE |
| void __sanitizer_print_stack_trace() { |
| BufferedStackTrace stack; |
| stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal); |
| #endif // CAN_SANITIZE_UB |