Convert ValueObject::Dump() to return llvm::Error() (NFCish)

This change by itself has no measurable effect on the LLDB
testsuite. I'm making it in preparation for threading through more
errors in the Swift language plugin.
This commit is contained in:
Adrian Prantl
2024-06-17 14:29:01 -07:00
parent 6bc71cdd32
commit d1bc75c0bc
20 changed files with 108 additions and 44 deletions

View File

@@ -1386,7 +1386,10 @@ public:
Stream &strm = result.GetOutputStream();
ValueObjectSP exception_object_sp = thread_sp->GetCurrentException();
if (exception_object_sp) {
exception_object_sp->Dump(strm);
if (llvm::Error error = exception_object_sp->Dump(strm)) {
result.AppendError(toString(std::move(error)));
return false;
}
}
ThreadSP exception_thread_sp = thread_sp->GetCurrentExceptionBacktrace();
@@ -1438,9 +1441,12 @@ public:
return false;
}
ValueObjectSP exception_object_sp = thread_sp->GetSiginfoValue();
if (exception_object_sp)
exception_object_sp->Dump(strm);
else
if (exception_object_sp) {
if (llvm::Error error = exception_object_sp->Dump(strm)) {
result.AppendError(toString(std::move(error)));
return false;
}
} else
strm.Printf("(no siginfo)\n");
strm.PutChar('\n');