[Lldb-commits] [PATCH] D64267: lldb_assert: abort when assertions are enabled.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 5 14:22:59 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365246: lldb_assert: abort when assertions are enabled. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64267?vs=208235&id=208239#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64267/new/

https://reviews.llvm.org/D64267

Files:
  lldb/trunk/source/Utility/LLDBAssert.cpp


Index: lldb/trunk/source/Utility/LLDBAssert.cpp
===================================================================
--- lldb/trunk/source/Utility/LLDBAssert.cpp
+++ lldb/trunk/source/Utility/LLDBAssert.cpp
@@ -21,6 +21,12 @@
   if (LLVM_LIKELY(expression))
     return;
 
+  // In a Debug configuration lldb_assert() behaves like assert().
+  assert(false && "lldb_assert failed");
+
+  // In a Release configuration it will print a warning and encourage the user
+  // to file a bug report, similar to LLVM’s crash handler, and then return
+  // execution.
   errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
                    expr_text, func, file, line);
   errs() << "backtrace leading to the failure:\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64267.208239.patch
Type: text/x-patch
Size: 741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190705/cd4ec882/attachment-0001.bin>


More information about the lldb-commits mailing list