[Lldb-commits] [PATCH] D104380: [lldb] Set return object failed status even if error string is empty

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 17 04:21:00 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG983ed1b58ef9: [lldb] Set return object failed status even if error string is empty (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104380/new/

https://reviews.llvm.org/D104380

Files:
  lldb/source/Interpreter/CommandReturnObject.cpp


Index: lldb/source/Interpreter/CommandReturnObject.cpp
===================================================================
--- lldb/source/Interpreter/CommandReturnObject.cpp
+++ lldb/source/Interpreter/CommandReturnObject.cpp
@@ -98,9 +98,9 @@
 }
 
 void CommandReturnObject::AppendError(llvm::StringRef in_string) {
+  SetStatus(eReturnStatusFailed);
   if (in_string.empty())
     return;
-  SetStatus(eReturnStatusFailed);
   error(GetErrorStream()) << in_string.rtrim() << '\n';
 }
 
@@ -113,6 +113,7 @@
 }
 
 void CommandReturnObject::SetError(llvm::StringRef error_str) {
+  SetStatus(eReturnStatusFailed);
   if (error_str.empty())
     return;
 
@@ -123,10 +124,10 @@
 // append "\n" to the end of it.
 
 void CommandReturnObject::AppendRawError(llvm::StringRef in_string) {
+  SetStatus(eReturnStatusFailed);
   if (in_string.empty())
     return;
   GetErrorStream() << in_string;
-  SetStatus(eReturnStatusFailed);
 }
 
 void CommandReturnObject::SetStatus(ReturnStatus status) { m_status = status; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104380.352675.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210617/d37d4f73/attachment.bin>


More information about the lldb-commits mailing list