[Lldb-commits] [lldb] r183577 - Don't retry the Connect when starting up debugserver if the reason for the previous failure was

Jim Ingham jingham at apple.com
Fri Jun 7 15:09:54 PDT 2013


Author: jingham
Date: Fri Jun  7 17:09:53 2013
New Revision: 183577

URL: http://llvm.org/viewvc/llvm-project?rev=183577&view=rev
Log:
Don't retry the Connect when starting up debugserver if the reason for the previous failure was
EINTR.  That means the user was trying to interrupt us, and we should just stop instead.

<rdar://problem/13184758>

Modified:
    lldb/trunk/include/lldb/Core/Error.h
    lldb/trunk/source/Core/Error.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/include/lldb/Core/Error.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Error.h?rev=183577&r1=183576&r2=183577&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Error.h (original)
+++ lldb/trunk/include/lldb/Core/Error.h Fri Jun  7 17:09:53 2013
@@ -283,6 +283,19 @@ public:
     //------------------------------------------------------------------
     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:
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Error.cpp?rev=183577&r1=183576&r2=183577&view=diff
==============================================================================
--- lldb/trunk/source/Core/Error.cpp (original)
+++ lldb/trunk/source/Core/Error.cpp Fri Jun  7 17:09:53 2013
@@ -387,3 +387,13 @@ Error::Success() const
 {
     return m_code == 0;
 }
+
+bool
+Error::WasInterrupted() const
+{
+    if (m_type == eErrorTypePOSIX && m_code == EINTR)
+        return true;
+    else
+        return false;
+}
+

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=183577&r1=183576&r2=183577&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri Jun  7 17:09:53 2013
@@ -744,8 +744,14 @@ ProcessGDBRemote::ConnectToDebugserver (
                 m_gdb_comm.SetConnection (conn_ap.release());
                 break;
             }
+            else if (error.WasInterrupted())
+            {
+                // If we were interrupted, don't keep retrying.
+                break;
+            }
+            
             retry_count++;
-
+            
             if (retry_count >= max_retry_count)
                 break;
 





More information about the lldb-commits mailing list