summaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2024-06-17 14:29:01 -0700
committerAdrian Prantl <aprantl@apple.com>2024-06-20 10:32:06 -0700
commitd1bc75c0bce141b94f9afadfde4e784760735ec0 (patch)
tree03017088ee5f5862a92de9630b95182e8f26bb70 /lldb/source/Commands/CommandObjectThread.cpp
parent6bc71cdd32de0add80d620b1342b5549efff363a (diff)
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.
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp14
1 files changed, 10 insertions, 4 deletions
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');