================
@@ -112,8 +113,46 @@ void CommandReturnObject::SetError(Status error) {
 }
 
 void CommandReturnObject::SetError(llvm::Error error) {
-  if (error)
+  // Retrieve any diagnostics.
+  error = llvm::handleErrors(std::move(error), [&](ExpressionErrorBase &error) 
{
+    SetStatus(eReturnStatusFailed);
+    m_diagnostics = error.GetDetails();
+  });
+  if (error) {
     AppendError(llvm::toString(std::move(error)));
+  }
+}
+
+llvm::StringRef
+CommandReturnObject::GetInlineDiagnosticsData(unsigned indent,
----------------
jimingham wrote:

This API seems wrong to me.  You have the CommandReturnObject being made up for 
some command that got executed, so I should know what that command was.  Then I 
have another API where I can pass in (if I feel like it) an entirely unrelated 
string as the "command".  Then I have some m_user_input which is some subset of 
what the user actually input for the command.
Maybe I'm missing something, but this is confusing to me.

https://github.com/llvm/llvm-project/pull/110901
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to