[Lldb-commits] [PATCH] D111908: [lldb] [Utility] Remove Status::WasInterrupted() along with its only use

2021-10-18 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG239b4d62b6c0: [lldb] [Utility] Remove 
Status::WasInterrupted() along with its only use (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111908

Files:
  lldb/include/lldb/Utility/Status.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Utility/Status.cpp


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -287,10 +287,6 @@
 // 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::format(
 const lldb_private::Status &error, llvm::raw_ostream &OS,
 llvm::StringRef Options) {
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -872,9 +872,6 @@
 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++;
Index: lldb/include/lldb/Utility/Status.h
===
--- lldb/include/lldb/Utility/Status.h
+++ lldb/include/lldb/Utility/Status.h
@@ -184,16 +184,6 @@
   /// 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.


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -287,10 +287,6 @@
 // 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::format(
 const lldb_private::Status &error, llvm::raw_ostream &OS,
 llvm::StringRef Options) {
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -872,9 +872,6 @@
 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++;
Index: lldb/include/lldb/Utility/Status.h
===
--- lldb/include/lldb/Utility/Status.h
+++ lldb/include/lldb/Utility/Status.h
@@ -184,16 +184,6 @@
   /// 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.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D111908: [lldb] [Utility] Remove Status::WasInterrupted() along with its only use

2021-10-18 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Yeah, random signals should cause a retry (they probably do already) and I 
think user interrupts should be handled differently (at a higher level).


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

https://reviews.llvm.org/D111908

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D111908: [lldb] [Utility] Remove Status::WasInterrupted() along with its only use

2021-10-16 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

FTR, this doesn't make `^c` work any better or worse.


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

https://reviews.llvm.org/D111908

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D111908: [lldb] [Utility] Remove Status::WasInterrupted() along with its only use

2021-10-15 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste, teemperor.
mgorny requested review of this revision.

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.


https://reviews.llvm.org/D111908

Files:
  lldb/include/lldb/Utility/Status.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Utility/Status.cpp


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -287,10 +287,6 @@
 // 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::format(
 const lldb_private::Status &error, llvm::raw_ostream &OS,
 llvm::StringRef Options) {
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -843,9 +843,6 @@
 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++;
Index: lldb/include/lldb/Utility/Status.h
===
--- lldb/include/lldb/Utility/Status.h
+++ lldb/include/lldb/Utility/Status.h
@@ -184,16 +184,6 @@
   /// 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.


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -287,10 +287,6 @@
 // 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::format(
 const lldb_private::Status &error, llvm::raw_ostream &OS,
 llvm::StringRef Options) {
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -843,9 +843,6 @@
 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++;
Index: lldb/include/lldb/Utility/Status.h
===
--- lldb/include/lldb/Utility/Status.h
+++ lldb/include/lldb/Utility/Status.h
@@ -184,16 +184,6 @@
   /// 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.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits