[Lldb-commits] [lldb] [lldb] Turn lldb_private::Status into a value type. (PR #106163)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 27 08:45:43 PDT 2024
adrian-prantl wrote:
> I worry the assert will kill the LLDB library and cause issues. Can we add a temporary setting that can override this in case it does cause crashes? I really don't want LLDB crashing if we can help it. It will be hard to test all of the error code paths that can happen out in the wild
@clayborg When I say assert I had in mind something like this:
```
Status &Status::operator=() {
assert(IsSuccess() && "dropping an error Status without checking first");
#if NDEBUG
if (!IsSuccess())
Debugger::ReportWarning("dropping an error Status without checking first");
#endif
...
```
So it would only "crash" in an asserts build, but otherwise keep working in production. Does that address you concern?
I'm also not planning to change the contract of the SBAPI. You'll still be able to modify SBError without triggering an assertion. It will check and log m_status under the hood.
https://github.com/llvm/llvm-project/pull/106163
More information about the lldb-commits
mailing list