Skip to content

[lldb] Make deep copies of Status explicit (NFC) #107170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

adrian-prantl
Copy link
Collaborator

Broken out from #106774 for easier review.

@adrian-prantl adrian-prantl requested review from bulbazord and medismailben and removed request for JDevlieghere September 4, 2024 00:05
@llvmbot llvmbot added the lldb label Sep 4, 2024
@adrian-prantl adrian-prantl requested a review from labath September 4, 2024 00:05
@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2024

@llvm/pr-subscribers-lldb

Author: Adrian Prantl (adrian-prantl)

Changes

Broken out from #106774 for easier review.


Patch is 108.56 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/107170.diff

91 Files Affected:

  • (modified) lldb/bindings/python/python-swigsafecast.swig (+1-1)
  • (modified) lldb/include/lldb/API/SBError.h (+2-2)
  • (modified) lldb/include/lldb/API/SBValueList.h (+1-1)
  • (modified) lldb/include/lldb/Core/ValueObjectConstResult.h (+2-2)
  • (modified) lldb/include/lldb/Target/Process.h (-2)
  • (modified) lldb/include/lldb/Utility/Status.h (+58-4)
  • (modified) lldb/source/API/SBBreakpoint.cpp (+3-3)
  • (modified) lldb/source/API/SBBreakpointLocation.cpp (+2-2)
  • (modified) lldb/source/API/SBBreakpointName.cpp (+8-9)
  • (modified) lldb/source/API/SBDebugger.cpp (+2-2)
  • (modified) lldb/source/API/SBError.cpp (+9-6)
  • (modified) lldb/source/API/SBFile.cpp (+5-10)
  • (modified) lldb/source/API/SBFormat.cpp (+1-1)
  • (modified) lldb/source/API/SBFrame.cpp (+5-4)
  • (modified) lldb/source/API/SBPlatform.cpp (+2-2)
  • (modified) lldb/source/API/SBProcess.cpp (+1-1)
  • (modified) lldb/source/API/SBSaveCoreOptions.cpp (+1-2)
  • (modified) lldb/source/API/SBStructuredData.cpp (+1-1)
  • (modified) lldb/source/API/SBTarget.cpp (+4-3)
  • (modified) lldb/source/API/SBThread.cpp (+1-1)
  • (modified) lldb/source/API/SBValue.cpp (+2-2)
  • (modified) lldb/source/API/SBValueList.cpp (+7-6)
  • (modified) lldb/source/API/SBWatchpoint.cpp (+1-1)
  • (modified) lldb/source/Commands/CommandObjectBreakpoint.cpp (+57-46)
  • (modified) lldb/source/Commands/CommandObjectCommands.cpp (+2-2)
  • (modified) lldb/source/Commands/CommandObjectMemoryTag.cpp (+5-5)
  • (modified) lldb/source/Commands/CommandObjectStats.cpp (+3-3)
  • (modified) lldb/source/Commands/CommandObjectTrace.cpp (+1-1)
  • (modified) lldb/source/Core/Debugger.cpp (+1-1)
  • (modified) lldb/source/Core/ModuleList.cpp (+2-3)
  • (modified) lldb/source/Core/PluginManager.cpp (+1-1)
  • (modified) lldb/source/Core/ThreadedCommunication.cpp (+1-1)
  • (modified) lldb/source/Core/ValueObject.cpp (+2-2)
  • (modified) lldb/source/Core/ValueObjectCast.cpp (+1-1)
  • (modified) lldb/source/Core/ValueObjectConstResult.cpp (+5-4)
  • (modified) lldb/source/Core/ValueObjectDynamicValue.cpp (+1-1)
  • (modified) lldb/source/Core/ValueObjectSyntheticFilter.cpp (+1-1)
  • (modified) lldb/source/Core/ValueObjectVTable.cpp (+1-1)
  • (modified) lldb/source/Core/ValueObjectVariable.cpp (+1-1)
  • (modified) lldb/source/DataFormatters/VectorType.cpp (+1-1)
  • (modified) lldb/source/Expression/FunctionCaller.cpp (+1-2)
  • (modified) lldb/source/Expression/LLVMUserExpression.cpp (+3-3)
  • (modified) lldb/source/Expression/Materializer.cpp (+1-1)
  • (modified) lldb/source/Expression/UserExpression.cpp (+4-4)
  • (modified) lldb/source/Host/common/FileCache.cpp (+1-1)
  • (modified) lldb/source/Host/common/LockFileBase.cpp (+2-2)
  • (modified) lldb/source/Host/common/NativeProcessProtocol.cpp (+5-5)
  • (modified) lldb/source/Host/common/TCPSocket.cpp (+3-3)
  • (modified) lldb/source/Host/macosx/objcxx/Host.mm (+1-1)
  • (modified) lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp (+9-9)
  • (modified) lldb/source/Interpreter/CommandInterpreter.cpp (+1-1)
  • (modified) lldb/source/Interpreter/CommandObject.cpp (+1-1)
  • (modified) lldb/source/Interpreter/OptionValueRegex.cpp (+1-1)
  • (modified) lldb/source/Interpreter/ScriptInterpreter.cpp (+1-1)
  • (modified) lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp (+1-1)
  • (modified) lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (+1-1)
  • (modified) lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp (+1-1)
  • (modified) lldb/source/Plugins/Platform/Android/AdbClient.cpp (+4-4)
  • (modified) lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp (+2-2)
  • (modified) lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h (+1-1)
  • (modified) lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm (+7-7)
  • (modified) lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (+2-2)
  • (modified) lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp (+2-2)
  • (modified) lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp (+5-5)
  • (modified) lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp (+1-1)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (+1-1)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (+1-1)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (+1-1)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (+4-4)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp (+1-1)
  • (modified) lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp (+1-1)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp (+3-3)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h (+7-3)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp (+11-11)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (+5-5)
  • (modified) lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp (+1-1)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h (+1-1)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (+1-1)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (+1-1)
  • (modified) lldb/source/Target/ModuleCache.cpp (+2-2)
  • (modified) lldb/source/Target/Platform.cpp (+3-3)
  • (modified) lldb/source/Target/Process.cpp (+4-41)
  • (modified) lldb/source/Target/StackFrame.cpp (+2-2)
  • (modified) lldb/source/Target/Target.cpp (+5-7)
  • (modified) lldb/source/Target/Thread.cpp (+2-1)
  • (modified) lldb/source/Utility/Scalar.cpp (+1-1)
  • (modified) lldb/source/Utility/Status.cpp (+39-4)
  • (modified) lldb/source/Utility/StructuredData.cpp (+1-1)
  • (modified) lldb/unittests/Target/RemoteAwarePlatformTest.cpp (+5-4)
  • (modified) lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h (+2-2)
  • (modified) lldb/unittests/Utility/StatusTest.cpp (+9-5)
diff --git a/lldb/bindings/python/python-swigsafecast.swig b/lldb/bindings/python/python-swigsafecast.swig
index 34f8c6f0ff8d35..bffd10ae7b3315 100644
--- a/lldb/bindings/python/python-swigsafecast.swig
+++ b/lldb/bindings/python/python-swigsafecast.swig
@@ -34,7 +34,7 @@ PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp) {
 }
 
 PythonObject SWIGBridge::ToSWIGWrapper(const Status& status) {
-  return ToSWIGHelper(new lldb::SBError(status), SWIGTYPE_p_lldb__SBError);
+  return ToSWIGHelper(new lldb::SBError(status.Clone()), SWIGTYPE_p_lldb__SBError);
 }
 
 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData> data_sb) {
diff --git a/lldb/include/lldb/API/SBError.h b/lldb/include/lldb/API/SBError.h
index 17f2c6c3027af7..9f55f92131c06e 100644
--- a/lldb/include/lldb/API/SBError.h
+++ b/lldb/include/lldb/API/SBError.h
@@ -97,7 +97,7 @@ class LLDB_API SBError {
   friend class lldb_private::ScriptInterpreter;
   friend class lldb_private::python::SWIGBridge;
 
-  SBError(const lldb_private::Status &error);
+  SBError(lldb_private::Status &&error);
 
   lldb_private::Status *get();
 
@@ -107,7 +107,7 @@ class LLDB_API SBError {
 
   lldb_private::Status &ref();
 
-  void SetError(const lldb_private::Status &lldb_error);
+  void SetError(lldb_private::Status &&lldb_error);
 
 private:
   std::unique_ptr<lldb_private::Status> m_opaque_up;
diff --git a/lldb/include/lldb/API/SBValueList.h b/lldb/include/lldb/API/SBValueList.h
index a5017bccc50533..52a86f989e153a 100644
--- a/lldb/include/lldb/API/SBValueList.h
+++ b/lldb/include/lldb/API/SBValueList.h
@@ -96,7 +96,7 @@ class LLDB_API SBValueList {
 
   std::unique_ptr<ValueListImpl> m_opaque_up;
 
-  void SetError(const lldb_private::Status &status);
+  void SetError(lldb_private::Status &&status);
 };
 
 } // namespace lldb
diff --git a/lldb/include/lldb/Core/ValueObjectConstResult.h b/lldb/include/lldb/Core/ValueObjectConstResult.h
index d3b3362bd0e9ec..9c34617af71d0d 100644
--- a/lldb/include/lldb/Core/ValueObjectConstResult.h
+++ b/lldb/include/lldb/Core/ValueObjectConstResult.h
@@ -61,7 +61,7 @@ class ValueObjectConstResult : public ValueObject {
 
   // When an expression fails to evaluate, we return an error
   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
-                                    const Status &error);
+                                    Status &&error);
 
   std::optional<uint64_t> GetByteSize() override;
 
@@ -146,7 +146,7 @@ class ValueObjectConstResult : public ValueObject {
                          ConstString name, Module *module = nullptr);
 
   ValueObjectConstResult(ExecutionContextScope *exe_scope,
-                         ValueObjectManager &manager, const Status &error);
+                         ValueObjectManager &manager, Status &&error);
 
   ValueObject *CreateChildAtIndex(size_t idx) override {
     return m_impl.CreateChildAtIndex(idx);
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index a7de991104434d..c66cfb2c245efd 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1296,8 +1296,6 @@ class Process : public std::enable_shared_from_this<Process>,
                 const EvaluateExpressionOptions &options,
                 DiagnosticManager &diagnostic_manager);
 
-  static const char *ExecutionResultAsCString(lldb::ExpressionResults result);
-
   void GetStatus(Stream &ostrm);
 
   size_t GetThreadStatus(Stream &ostrm, bool only_threads_with_stop_reason,
diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h
index b304291ffae00e..c241a67d027c67 100644
--- a/lldb/include/lldb/Utility/Status.h
+++ b/lldb/include/lldb/Utility/Status.h
@@ -26,6 +26,36 @@ class raw_ostream;
 
 namespace lldb_private {
 
+class MachKernelError
+    : public llvm::ErrorInfo<MachKernelError, llvm::StringError> {
+public:
+  using llvm::ErrorInfo<MachKernelError, llvm::StringError>::ErrorInfo;
+  MachKernelError(std::error_code ec, const llvm::Twine &msg = {})
+      : ErrorInfo(msg, ec) {}
+  std::string message() const override;
+  static char ID;
+};
+
+class Win32Error : public llvm::ErrorInfo<Win32Error, llvm::StringError> {
+public:
+  using llvm::ErrorInfo<Win32Error, llvm::StringError>::ErrorInfo;
+  Win32Error(std::error_code ec, const llvm::Twine &msg = {})
+      : ErrorInfo(msg, ec) {}
+  std::string message() const override;
+  static char ID;
+};
+
+class ExpressionError
+    : public llvm::ErrorInfo<ExpressionError, llvm::StringError> {
+public:
+  using llvm::ErrorInfo<ExpressionError, llvm::StringError>::ErrorInfo;
+  ExpressionError(std::error_code ec, std::string msg = {})
+      : ErrorInfo(msg, ec) {}
+  static char ID;
+};
+
+const char *ExecutionResultAsCString(lldb::ExpressionResults result);
+
 /// \class Status Status.h "lldb/Utility/Status.h" An error handling class.
 ///
 /// This class is designed to be able to hold any error code that can be
@@ -41,13 +71,32 @@ namespace lldb_private {
 /// of themselves for printing results and error codes. The string value will
 /// be fetched on demand and its string value will be cached until the error
 /// is cleared of the value of the error changes.
+///
+/// API design notes:
+///
+/// Most APIs that currently vend a Status would be better served by
+/// returning llvm::Expected<> instead. If possibles APIs should be
+/// refactored to avoid Status. The only legitimate long-term uses of
+/// Status are objects that need to store an error for a long time
+/// (which should be questioned as a design decision, too).
+///
+/// Implementation notes:
+///
+/// Internally, Status stores an llvm::Error.
+///   eErrorTypeInvalid
+///   eErrorTypeGeneric      llvm::StringError
+///   eErrorTypePOSIX        llvm::ECError
+///   eErrorTypeMachKernel   MachKernelError
+///   eErrorTypeExpression   llvm::ErrorList<ExpressionError>
+///   eErrorTypeWin32        Win32Error
+
 class Status {
 public:
-  /// Every error value that this object can contain needs to be able to fit
   /// into ValueType.
   typedef uint32_t ValueType;
 
   Status();
+  Status(Status &&other) = default;
 
   /// Initialize the error object with a generic success value.
   ///
@@ -91,10 +140,14 @@ class Status {
 
   ~Status();
 
-  // llvm::Error support
-  explicit Status(llvm::Error error) { *this = std::move(error); }
-  const Status &operator=(llvm::Error error);
+  const Status &operator=(Status &&);
+  /// Avoid using this in new code. Migrate APIs to llvm::Expected instead.
+  static Status FromError(llvm::Error &&error);
+  /// FIXME: Replace this with a takeError() method.
   llvm::Error ToError() const;
+  /// Don't call this function in new code. Instead, redesign the API
+  /// to use llvm::Expected instead of Status.
+  Status Clone() const { return Status(ToError()); }
 
   /// Get the error string associated with the current error.
   //
@@ -145,6 +198,7 @@ class Status {
   bool Success() const;
 
 protected:
+  Status(llvm::Error &&error);
   /// Status code as an integer value.
   ValueType m_code = 0;
   /// The type of the above error code.
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index 3e9c01080588e5..b2ed034d19983c 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -622,7 +622,7 @@ SBError SBBreakpoint::SetScriptCallbackFunction(
                                                callback_function_name,
                                                extra_args.m_impl_up
                                                    ->GetObjectSP());
-    sb_error.SetError(error);
+    sb_error.SetError(std::move(error));
   } else
     sb_error = Status::FromErrorString("invalid breakpoint");
 
@@ -645,7 +645,7 @@ SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
             .GetScriptInterpreter()
             ->SetBreakpointCommandCallback(bp_options, callback_body_text,
                                            /*is_callback=*/false);
-    sb_error.SetError(error);
+    sb_error.SetError(std::move(error));
   } else
     sb_error = Status::FromErrorString("invalid breakpoint");
 
@@ -670,7 +670,7 @@ SBError SBBreakpoint::AddNameWithErrorHandling(const char *new_name) {
         bkpt_sp->GetTarget().GetAPIMutex());
     Status error;
     bkpt_sp->GetTarget().AddNameToBreakpoint(bkpt_sp, new_name, error);
-    status.SetError(error);
+    status.SetError(std::move(error));
   } else {
     status = Status::FromErrorString("invalid breakpoint");
   }
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index e5c96b81e80904..b2d1da3927c6ea 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -239,7 +239,7 @@ SBError SBBreakpointLocation::SetScriptCallbackFunction(
                                                callback_function_name,
                                                extra_args.m_impl_up
                                                    ->GetObjectSP());
-      sb_error.SetError(error);
+    sb_error.SetError(std::move(error));
     } else
       sb_error = Status::FromErrorString("invalid breakpoint");
 
@@ -264,7 +264,7 @@ SBBreakpointLocation::SetScriptCallbackBody(const char *callback_body_text) {
             .GetScriptInterpreter()
             ->SetBreakpointCommandCallback(bp_options, callback_body_text,
                                            /*is_callback=*/false);
-    sb_error.SetError(error);
+    sb_error.SetError(std::move(error));
   } else
     sb_error = Status::FromErrorString("invalid breakpoint");
 
diff --git a/lldb/source/API/SBBreakpointName.cpp b/lldb/source/API/SBBreakpointName.cpp
index 7dc8dee19f43d2..831260d44e8e7f 100644
--- a/lldb/source/API/SBBreakpointName.cpp
+++ b/lldb/source/API/SBBreakpointName.cpp
@@ -570,14 +570,13 @@ SBError SBBreakpointName::SetScriptCallbackFunction(
         m_impl_up->GetTarget()->GetAPIMutex());
 
   BreakpointOptions &bp_options = bp_name->GetOptions();
-  Status error;
-  error = m_impl_up->GetTarget()
-              ->GetDebugger()
-              .GetScriptInterpreter()
-              ->SetBreakpointCommandCallbackFunction(
-                  bp_options, callback_function_name,
-                  extra_args.m_impl_up->GetObjectSP());
-  sb_error.SetError(error);
+  Status error = m_impl_up->GetTarget()
+                     ->GetDebugger()
+                     .GetScriptInterpreter()
+                     ->SetBreakpointCommandCallbackFunction(
+                         bp_options, callback_function_name,
+                         extra_args.m_impl_up->GetObjectSP());
+  sb_error.SetError(std::move(error));
   UpdateName(*bp_name);
   return sb_error;
 }
@@ -600,7 +599,7 @@ SBBreakpointName::SetScriptCallbackBody(const char *callback_body_text) {
                      .GetScriptInterpreter()
                      ->SetBreakpointCommandCallback(
                          bp_options, callback_body_text, /*is_callback=*/false);
-  sb_error.SetError(error);
+  sb_error.SetError(std::move(error));
   if (!sb_error.Fail())
     UpdateName(*bp_name);
 
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 72501570320d57..b21d7e67290073 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -220,7 +220,7 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() {
   SBError error;
   if (auto e = g_debugger_lifetime->Initialize(
           std::make_unique<SystemInitializerFull>(), LoadPlugin)) {
-    error.SetError(Status(std::move(e)));
+    error.SetError(Status::FromError(std::move(e)));
   }
   return error;
 }
@@ -1360,7 +1360,7 @@ SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
         "invalid debugger instance name '%s'", debugger_instance_name);
   }
   if (error.Fail())
-    sb_error.SetError(error);
+    sb_error.SetError(std::move(error));
   return sb_error;
 }
 
diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp
index 30d9ccc78ee376..31964931649db3 100644
--- a/lldb/source/API/SBError.cpp
+++ b/lldb/source/API/SBError.cpp
@@ -23,7 +23,8 @@ SBError::SBError() { LLDB_INSTRUMENT_VA(this); }
 SBError::SBError(const SBError &rhs) {
   LLDB_INSTRUMENT_VA(this, rhs);
 
-  m_opaque_up = clone(rhs.m_opaque_up);
+  if (rhs.m_opaque_up)
+    m_opaque_up = std::make_unique<Status>(rhs.m_opaque_up->Clone());
 }
 
 SBError::SBError(const char *message) {
@@ -32,8 +33,8 @@ SBError::SBError(const char *message) {
   SetErrorString(message);
 }
 
-SBError::SBError(const lldb_private::Status &status)
-    : m_opaque_up(new Status(status)) {
+SBError::SBError(lldb_private::Status &&status)
+    : m_opaque_up(new Status(std::move(status))) {
   LLDB_INSTRUMENT_VA(this, status);
 }
 
@@ -43,7 +44,9 @@ const SBError &SBError::operator=(const SBError &rhs) {
   LLDB_INSTRUMENT_VA(this, rhs);
 
   if (this != &rhs)
-    m_opaque_up = clone(rhs.m_opaque_up);
+    if (rhs.m_opaque_up)
+      m_opaque_up = std::make_unique<Status>(rhs.m_opaque_up->Clone());
+
   return *this;
 }
 
@@ -111,9 +114,9 @@ void SBError::SetError(uint32_t err, ErrorType type) {
   *m_opaque_up = Status(err, type);
 }
 
-void SBError::SetError(const Status &lldb_error) {
+void SBError::SetError(Status &&lldb_error) {
   CreateIfNeeded();
-  *m_opaque_up = lldb_error;
+  *m_opaque_up = std::move(lldb_error);
 }
 
 void SBError::SetErrorToErrno() {
diff --git a/lldb/source/API/SBFile.cpp b/lldb/source/API/SBFile.cpp
index 623708780f4c67..2ae4b1481afbf2 100644
--- a/lldb/source/API/SBFile.cpp
+++ b/lldb/source/API/SBFile.cpp
@@ -62,8 +62,7 @@ SBError SBFile::Read(uint8_t *buf, size_t num_bytes, size_t *bytes_read) {
     error = Status::FromErrorString("invalid SBFile");
     *bytes_read = 0;
   } else {
-    Status status = m_opaque_sp->Read(buf, num_bytes);
-    error.SetError(status);
+    error.SetError(m_opaque_sp->Read(buf, num_bytes));
     *bytes_read = num_bytes;
   }
   return error;
@@ -78,8 +77,7 @@ SBError SBFile::Write(const uint8_t *buf, size_t num_bytes,
     error = Status::FromErrorString("invalid SBFile");
     *bytes_written = 0;
   } else {
-    Status status = m_opaque_sp->Write(buf, num_bytes);
-    error.SetError(status);
+    error.SetError(m_opaque_sp->Write(buf, num_bytes));
     *bytes_written = num_bytes;
   }
   return error;
@@ -92,8 +90,7 @@ SBError SBFile::Flush() {
   if (!m_opaque_sp) {
     error = Status::FromErrorString("invalid SBFile");
   } else {
-    Status status = m_opaque_sp->Flush();
-    error.SetError(status);
+    error.SetError(m_opaque_sp->Flush());
   }
   return error;
 }
@@ -106,10 +103,8 @@ bool SBFile::IsValid() const {
 SBError SBFile::Close() {
   LLDB_INSTRUMENT_VA(this);
   SBError error;
-  if (m_opaque_sp) {
-    Status status = m_opaque_sp->Close();
-    error.SetError(status);
-  }
+  if (m_opaque_sp)
+    error.SetError(m_opaque_sp->Close());
   return error;
 }
 
diff --git a/lldb/source/API/SBFormat.cpp b/lldb/source/API/SBFormat.cpp
index 51cddceea0372e..080e219d64a362 100644
--- a/lldb/source/API/SBFormat.cpp
+++ b/lldb/source/API/SBFormat.cpp
@@ -36,7 +36,7 @@ SBFormat::SBFormat(const char *format, lldb::SBError &error) {
   FormatEntrySP format_entry_sp = std::make_shared<FormatEntity::Entry>();
   Status status = FormatEntity::Parse(format, *format_entry_sp);
 
-  error.SetError(status);
+  error.SetError(std::move(status));
   if (error.Success())
     m_opaque_sp = format_entry_sp;
 }
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index b1360e88bcd3af..30c44b974988d0 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -809,7 +809,7 @@ SBValueList SBFrame::GetVariables(const lldb::SBVariablesOptions &options) {
         Status var_error;
         variable_list = frame->GetVariableList(true, &var_error);
         if (var_error.Fail())
-          value_list.SetError(var_error);
+          value_list.SetError(std::move(var_error));
         if (variable_list) {
           const size_t num_variables = variable_list->GetSize();
           if (num_variables) {
@@ -1033,7 +1033,8 @@ SBValue SBFrame::EvaluateExpression(const char *expr) {
     Status error;
     error = Status::FromErrorString("can't evaluate expressions when the "
                                     "process is running.");
-    ValueObjectSP error_val_sp = ValueObjectConstResult::Create(nullptr, error);
+    ValueObjectSP error_val_sp =
+        ValueObjectConstResult::Create(nullptr, std::move(error));
     result.SetSP(error_val_sp, false);
   }
   return result;
@@ -1129,13 +1130,13 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
       Status error;
       error = Status::FromErrorString("can't evaluate expressions when the "
                                       "process is running.");
-      expr_value_sp = ValueObjectConstResult::Create(nullptr, error);
+      expr_value_sp = ValueObjectConstResult::Create(nullptr, std::move(error));
       expr_result.SetSP(expr_value_sp, false);
     }
   } else {
       Status error;
       error = Status::FromErrorString("sbframe object is not valid.");
-      expr_value_sp = ValueObjectConstResult::Create(nullptr, error);
+      expr_value_sp = ValueObjectConstResult::Create(nullptr, std::move(error));
       expr_result.SetSP(expr_value_sp, false);
   }
 
diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp
index 2f0f925302f16e..394268b77aa21f 100644
--- a/lldb/source/API/SBPlatform.cpp
+++ b/lldb/source/API/SBPlatform.cpp
@@ -586,7 +586,7 @@ SBProcess SBPlatform::Attach(SBAttachInfo &attach_info,
       Status status;
       ProcessSP process_sp = platform_sp->Attach(info, debugger.ref(),
                                                  target.GetSP().get(), status);
-      error.SetError(status);
+      error.SetError(std::move(status));
       return SBProcess(process_sp);
     }
 
@@ -728,7 +728,7 @@ SBError SBPlatform::SetLocateModuleCallback(
           symbol_file_spec = symbol_file_spec_sb.ref();
         }
 
-        return error.ref();
+        return error.ref().Clone();
       });
   return SBError();
 }
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 3eed51f0245f6f..9773144723c34c 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -1450,7 +1450,7 @@ lldb::SBError SBProcess::DeallocateMemory(lldb::addr_t ptr) {
       std::lock_guard<std::recursive_mutex> guard(
           process_sp->GetTarget().GetAPIMutex());
       Status error = process_sp->DeallocateMemory(ptr);
-      sb_error.SetError(error);
+      sb_error.SetError(std::move(error));
     } else {
       sb_error = Status::FromErrorString("process is running");
     }
diff --git a/lldb/source/API/SBSaveCoreOptions.cpp b/lldb/source/API/SBSaveCoreOptions.cpp
index 2cd431611ef558..ef82b0253f1199 100644
--- a/lldb/source/API/SBSaveCoreOptions.cpp
+++ b/lldb/source/API/SBSaveCoreOptions.cpp
@@ -40,8 +40,7 @@ SBSaveCoreOptions::operator=(const SBSaveCoreOptions &rhs) {
 
 SBError SBSaveCoreOptions::SetPluginName(const char *name) {
   LLDB_INSTRUMENT_VA(this, name);
-  lldb_private::Status error = m_opaque_up->SetPluginName(name);
-  return SBError(error);
+  return SBError(m_opaque_up->SetPluginName(name));
 }
 
 void SBSaveCoreOptions::SetStyle(lldb::SaveCoreStyle style) {
diff --git a/lldb/source/API/SBStructuredData.cpp b/lldb/source/API/SBStructuredData.cpp
index 801ebf45e0e524..b891a34bd7c76a 100644
--- a/lldb/source/API/SBStructuredData.cpp
+++ b/lldb/source/API/SBStructuredData.cpp
@@ -133,7 +133,7 @@ lldb::SBError SBStructuredData::GetDescription(lldb::SBStream &stream) const {
 
   Status error = m_impl_up->GetDescription(stream.ref());
   SBError sb_error;
-  sb_error.SetError(error);
+  sb_error.SetError(std::move(error));
   return sb_error;
 }
 
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index e927cb854cd88c..1c1f7e2a03def8 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1369,7 +1369,7 @@ SBTarget::WatchpointCreateByAddress(lldb::addr_t addr, size_t size,
     CompilerType *type = nullptr;
     watchpoint_sp =
         target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error);
-    error.SetError(cw_error);
+    error.SetError(std::move(cw_error));
     sb_watchpoint.SetSP(watchpo...
[truncated]

Copy link

github-actions bot commented Sep 4, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@felipepiovezan
Copy link
Contributor

I'm not if this is your intention, but the way LLVM has configured their github, your two nicely separated commits will be squashed :(

@felipepiovezan
Copy link
Contributor

Ah I've just noticed the other PR

@adrian-prantl
Copy link
Collaborator Author

Ah I've just noticed the other PR

Do we actually have abetter solution for stacked commits than what I'm doing here?

@felipepiovezan
Copy link
Contributor

Ah I've just noticed the other PR

Do we actually have abetter solution for stacked commits than what I'm doing here?

short answer is "maybe": https://llvm.org/docs/GitHub.html#using-graphite-for-stacked-pull-requests

@labath
Copy link
Collaborator

labath commented Sep 5, 2024

Ah I've just noticed the other PR

Do we actually have abetter solution for stacked commits than what I'm doing here?

This setup works fine for me, but I think it's worth calling out that you intend it to be viewed that way, as it's not the completely typical way to use github. ( I probably wouldn't have realized it if Felipe did not mention this)

@adrian-prantl adrian-prantl force-pushed the status-explicit-clone branch 3 times, most recently from e0a9855 to 8cdcc70 Compare September 5, 2024 19:39
@adrian-prantl adrian-prantl merged commit b798f4b into llvm:main Sep 5, 2024
4 of 5 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 5, 2024

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building lldb at step 4 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/5655

Here is the relevant piece of the build log for the reference
Step 4 (build) failure: build (failure)
...
39.282 [446/72/460] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/RegisterContextLinux_x86_64.cpp.o
39.379 [445/72/461] Building CXX object tools/lldb/source/Plugins/ObjectFile/ELF/CMakeFiles/lldbPluginObjectFileELF.dir/ObjectFileELF.cpp.o
39.394 [444/72/462] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/RegisterContextNetBSD_x86_64.cpp.o
39.531 [443/72/463] Building CXX object tools/lldb/source/Plugins/Language/CPlusPlus/CMakeFiles/lldbPluginCPlusPlusLanguage.dir/CPlusPlusLanguage.cpp.o
39.562 [442/72/464] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/RegisterInfos_x86_64_with_base_shared.cpp.o
39.685 [441/72/465] Building CXX object tools/lldb/source/Plugins/Platform/FreeBSD/CMakeFiles/lldbPluginPlatformFreeBSD.dir/PlatformFreeBSD.cpp.o
39.902 [440/72/466] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/MinidumpTypes.cpp.o
39.932 [439/72/467] Building CXX object tools/lldb/source/Plugins/Platform/Android/CMakeFiles/lldbPluginPlatformAndroid.dir/PlatformAndroid.cpp.o
40.205 [438/72/468] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunicationServerPlatform.cpp.o
40.294 [437/72/469] Building CXX object tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o
FAILED: tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o 
/usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb/source/Plugins/Process/Linux -I/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Process/Linux -I/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/include -I/home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb/include -I/home/worker/2.0.1/lldb-x86_64-debian/build/include -I/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/include -I/usr/include/python3.11 -I/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/../clang/include -I/home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb/../clang/include -I/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source -I/home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -MF tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o.d -o tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -c /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1100:13: error: object of type 'lldb_private::Status' cannot be assigned because its copy assignment operator is implicitly deleted
      error =
            ^
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy assignment operator is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1911:12: error: call to implicitly-deleted copy constructor of 'lldb_private::Status'
    return resume_result;
           ^~~~~~~~~~~~~
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy constructor is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1917:12: error: call to implicitly-deleted copy constructor of 'lldb_private::Status'
    return step_result;
           ^~~~~~~~~~~
/home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy constructor is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
3 errors generated.
40.359 [437/71/470] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunicationServerCommon.cpp.o
40.429 [437/70/471] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/ProcessGDBRemoteLog.cpp.o
40.503 [437/69/472] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunication.cpp.o
40.588 [437/68/473] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/HistoryUnwind.cpp.o
40.633 [437/67/474] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_32.cpp.o
40.668 [437/66/475] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_ARM64.cpp.o
40.702 [437/65/476] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_64.cpp.o
40.736 [437/64/477] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/HistoryThread.cpp.o
40.793 [437/63/478] Building CXX object tools/lldb/source/Plugins/Process/scripted/CMakeFiles/lldbPluginScriptedProcess.dir/ScriptedThread.cpp.o
40.798 [437/62/479] Building CXX object tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeFiles/lldbPluginAppleObjCRuntime.dir/AppleObjCRuntimeV2.cpp.o
40.905 [437/61/480] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_ARM.cpp.o
41.006 [437/60/481] Building CXX object tools/lldb/source/Plugins/Platform/Linux/CMakeFiles/lldbPluginPlatformLinux.dir/PlatformLinux.cpp.o
41.019 [437/59/482] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteRegisterContext.cpp.o
41.387 [437/58/483] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextPOSIXCore_mips64.cpp.o
41.410 [437/57/484] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextLinuxCore_x86_64.cpp.o
41.437 [437/56/485] Building CXX object tools/lldb/source/Plugins/Process/scripted/CMakeFiles/lldbPluginScriptedProcess.dir/ScriptedProcess.cpp.o
41.468 [437/55/486] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangExpressionParser.cpp.o
41.524 [437/54/487] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextPOSIXCore_x86_64.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 7, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building lldb at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/6830

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
85.597 [357/96/6522] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_ARM64.cpp.o
85.635 [356/96/6523] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangASTSource.cpp.o
85.642 [355/96/6524] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_32.cpp.o
85.651 [354/96/6525] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/CodeViewRegisterMapping.cpp.o
85.746 [353/96/6526] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunication.cpp.o
85.767 [352/96/6527] Building CXX object tools/lldb/source/Plugins/ObjectFile/ELF/CMakeFiles/lldbPluginObjectFileELF.dir/ObjectFileELF.cpp.o
85.797 [351/96/6528] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbFPOProgramToDWARFExpression.cpp.o
85.864 [350/96/6529] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_64.cpp.o
85.876 [349/96/6530] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbSymUid.cpp.o
85.958 [348/96/6531] Building CXX object tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o
FAILED: tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source/Plugins/Process/Linux -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/../clang/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -MF tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o.d -o tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -c /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1100:13: error: object of type 'lldb_private::Status' cannot be assigned because its copy assignment operator is implicitly deleted
      error =
            ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy assignment operator is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1911:12: error: call to implicitly-deleted copy constructor of 'lldb_private::Status'
    return resume_result;
           ^~~~~~~~~~~~~
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy constructor is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1917:12: error: call to implicitly-deleted copy constructor of 'lldb_private::Status'
    return step_result;
           ^~~~~~~~~~~
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy constructor is implicitly deleted because 'Status' has a user-declared move constructor
  Status(Status &&other) = default;
  ^
3 errors generated.
86.051 [348/95/6532] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunicationServerCommon.cpp.o
86.067 [348/94/6533] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/ProcessGDBRemoteLog.cpp.o
86.191 [348/93/6534] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/HistoryUnwind.cpp.o
86.430 [348/92/6535] Building CXX object tools/lldb/source/Plugins/Platform/FreeBSD/CMakeFiles/lldbPluginPlatformFreeBSD.dir/PlatformFreeBSD.cpp.o
86.706 [348/91/6536] Building CXX object tools/lldb/source/Plugins/Process/scripted/CMakeFiles/lldbPluginScriptedProcess.dir/ScriptedThread.cpp.o
86.749 [348/90/6537] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/HistoryThread.cpp.o
86.808 [348/89/6538] Building CXX object tools/lldb/source/Plugins/Platform/Android/CMakeFiles/lldbPluginPlatformAndroid.dir/PlatformAndroid.cpp.o
86.894 [348/88/6539] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/IRForTarget.cpp.o
86.933 [348/87/6540] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteRegisterContext.cpp.o
86.949 [348/86/6541] Building CXX object tools/lldb/source/Plugins/Platform/Linux/CMakeFiles/lldbPluginPlatformLinux.dir/PlatformLinux.cpp.o
87.137 [348/85/6542] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextLinuxCore_x86_64.cpp.o
87.248 [348/84/6543] Building CXX object tools/lldb/source/Plugins/Process/Utility/CMakeFiles/lldbPluginProcessUtility.dir/InferiorCallPOSIX.cpp.o
87.260 [348/83/6544] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextPOSIXCore_arm.cpp.o
87.269 [348/82/6545] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextPOSIXCore_mips64.cpp.o
87.286 [348/81/6546] Building CXX object tools/lldb/source/Plugins/Process/scripted/CMakeFiles/lldbPluginScriptedProcess.dir/ScriptedProcess.cpp.o
87.313 [348/80/6547] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangASTImporter.cpp.o
87.451 [348/79/6548] Building CXX object tools/lldb/source/Plugins/Process/elf-core/CMakeFiles/lldbPluginProcessElfCore.dir/RegisterContextPOSIXCore_ppc64le.cpp.o
87.533 [348/78/6549] Building CXX object tools/lldb/source/Plugins/Platform/NetBSD/CMakeFiles/lldbPluginPlatformNetBSD.dir/PlatformNetBSD.cpp.o

adrian-prantl added a commit to adrian-prantl/llvm-project that referenced this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants