[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 13:57:09 PDT 2019


JDevlieghere updated this revision to Diff 208235.
JDevlieghere added a comment.

Add comments with the exact wording from the docs.


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

https://reviews.llvm.org/D64267

Files:
  lldb/source/Utility/LLDBAssert.cpp


Index: lldb/source/Utility/LLDBAssert.cpp
===================================================================
--- lldb/source/Utility/LLDBAssert.cpp
+++ lldb/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.208235.patch
Type: text/x-patch
Size: 723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190705/e0d25543/attachment-0001.bin>


More information about the lldb-commits mailing list