From d1bc75c0bce141b94f9afadfde4e784760735ec0 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 17 Jun 2024 14:29:01 -0700 Subject: 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. --- lldb/source/Commands/CommandObjectThread.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lldb/source/Commands/CommandObjectThread.cpp') diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index bb2be560ebff..5e64dd2f8f08 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -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'); -- cgit v1.2.3