Skip to content

Commit

Permalink
Terminate debugger if an assert was hit
Browse files Browse the repository at this point in the history
Reviewers: JDevlieghere, teemperor, #lldb

Reviewed By: JDevlieghere

Subscribers: clayborg, lemo, lldb-commits

Differential Revision: https://reviews.llvm.org/D51604

llvm-svn: 341387
  • Loading branch information
davidbolvansky committed Sep 4, 2018
1 parent 9775a62 commit 4d46fde
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lldb/source/Utility/LLDBAssert.cpp
Expand Up @@ -19,14 +19,14 @@ using namespace lldb_private;
void lldb_private::lldb_assert(bool expression, const char *expr_text,
const char *func, const char *file,
unsigned int line) {
if (expression)
;
else {
errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
expr_text, func, file, line);
errs() << "backtrace leading to the failure:\n";
llvm::sys::PrintStackTrace(errs());
errs() << "please file a bug report against lldb reporting this failure "
"log, and as many details as possible\n";
}
if (LLVM_LIKELY(expression))
return;

errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
expr_text, func, file, line);
errs() << "backtrace leading to the failure:\n";
llvm::sys::PrintStackTrace(errs());
errs() << "please file a bug report against lldb reporting this failure "
"log, and as many details as possible\n";
abort();
}

0 comments on commit 4d46fde

Please sign in to comment.