26 llvm::StringRef backtrace,
27 llvm::StringRef prompt) {
28 llvm::errs() << message <<
'\n';
29 llvm::errs() << backtrace;
30 llvm::errs() << prompt <<
'\n';
36void _lldb_assert(
bool expression,
const char *expr_text,
const char *func,
37 const char *file,
unsigned int line,
38 std::once_flag &once_flag) {
39 if (LLVM_LIKELY(expression))
42 std::call_once(once_flag, [&]() {
43#if LLVM_SUPPORT_XCODE_SIGNPOSTS
44 if (__builtin_available(macos 10.12, iOS 10, tvOS 10, watchOS 3, *)) {
45 os_log_fault(OS_LOG_DEFAULT,
46 "Assertion failed: (%s), function %s, file %s, line %u\n",
47 expr_text, func, file, line);
52 llvm::raw_string_ostream backtrace(buffer);
53 llvm::sys::PrintStackTrace(backtrace);
57 "Assertion failed: ({0}), function {1}, file {2}, line {3}",
58 expr_text, func, file, line)
61 "Please file a bug report against lldb and include the backtrace, the "
62 "version and as many details as possible.");
void(* LLDBAssertCallback)(llvm::StringRef message, llvm::StringRef backtrace, llvm::StringRef prompt)
The default LLDB assert callback, which prints to stderr.
void _lldb_assert(bool expression, const char *expr_text, const char *func, const char *file, unsigned int line, std::once_flag &once_flag)
Don't use _lldb_assert directly.