[Lldb-commits] [PATCH] D59911: Don't abort() in lldb_assert and document why.

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 27 17:18:46 PDT 2019


aprantl marked an inline comment as done.
aprantl added inline comments.


================
Comment at: lldb/www/source.html:83
+                          <li>Assertions.
+                            Assertions (from <tt>assert.h</tt>) should be used liberally to assert internal consistency.
+                            Assertions shall <em>never</em> be used to detect invalid user input, such as malformed DWARF.
----------------
JDevlieghere wrote:
> What happens with asserts in release builds? If they don't cause the process to abort, then they're strictly worse than lldb_assert. 
The same thing that happens with them in LLVM; they disappear. I see the main benefit of assertions to guard against thoughtless refactoring, where the contract between components is broken. Ideally we'd encode the entire contract in the type system, but where that isn't possible we need assertions. But their primary use is when validating LLDB (ReleaseAsserts) against the testsuite.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59911





More information about the lldb-commits mailing list