Author: Michał Górny Date: 2021-10-18T10:50:25+02:00 New Revision: 239b4d62b6c07f27b1763a090f82c9f92ce06b8c
URL: https://github.com/llvm/llvm-project/commit/239b4d62b6c07f27b1763a090f82c9f92ce06b8c DIFF: https://github.com/llvm/llvm-project/commit/239b4d62b6c07f27b1763a090f82c9f92ce06b8c.diff LOG: [lldb] [Utility] Remove Status::WasInterrupted() along with its only use Remove Status::WasInterrupted() that checks whether the underlying error code matches EINTR. ProcessGDBRemote::ConnectToDebugserver() is its only call site, and it does not seem correct there. After all, EINTR is precisely when we want to retry, not stop retrying. Furthermore, it should not really matter since we should be catching EINTR immediately via llvm::sys::RetryAfterSignal() but that's another story. Differential Revision: https://reviews.llvm.org/D111908 Added: Modified: lldb/include/lldb/Utility/Status.h lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/source/Utility/Status.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h index 61d663bdccba4..bee2b57b6ea9e 100644 --- a/lldb/include/lldb/Utility/Status.h +++ b/lldb/include/lldb/Utility/Status.h @@ -184,16 +184,6 @@ class Status { /// success (non-erro), \b false otherwise. bool Success() const; - /// Test for a failure due to a generic interrupt. - /// - /// Returns true if the error code in this object was caused by an - /// interrupt. At present only supports Posix EINTR. - /// - /// \return - /// \b true if this object contains an value that describes - /// failure due to interrupt, \b false otherwise. - bool WasInterrupted() const; - protected: /// Member variables ValueType m_code = 0; ///< Status code as an integer value. diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 79a3941f4014b..8f2a31ac2fecb 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -872,9 +872,6 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) { if (conn_up->Connect(connect_url, &error) == eConnectionStatusSuccess) { m_gdb_comm.SetConnection(std::move(conn_up)); break; - } else if (error.WasInterrupted()) { - // If we were interrupted, don't keep retrying. - break; } retry_count++; diff --git a/lldb/source/Utility/Status.cpp b/lldb/source/Utility/Status.cpp index 72fd087decc06..e6d381421f28f 100644 --- a/lldb/source/Utility/Status.cpp +++ b/lldb/source/Utility/Status.cpp @@ -287,10 +287,6 @@ int Status::SetErrorStringWithVarArg(const char *format, va_list args) { // return value. bool Status::Success() const { return m_code == 0; } -bool Status::WasInterrupted() const { - return (m_type == eErrorTypePOSIX && m_code == EINTR); -} - void llvm::format_provider<lldb_private::Status>::format( const lldb_private::Status &error, llvm::raw_ostream &OS, llvm::StringRef Options) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits