summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-06-07 22:09:53 +0000
committerJim Ingham <jingham@apple.com>2013-06-07 22:09:53 +0000
commit4e5c821087d02c7e32e4ba5949d9217b690cbbad (patch)
tree989c961d283307cf0f7353cdf272624164162c42
parentfbbb8f32b014850640c635d776e78eabe3a40ba1 (diff)
downloadbcm5719-llvm-4e5c821087d02c7e32e4ba5949d9217b690cbbad.tar.gz
bcm5719-llvm-4e5c821087d02c7e32e4ba5949d9217b690cbbad.zip
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> llvm-svn: 183577
-rw-r--r--lldb/include/lldb/Core/Error.h13
-rw-r--r--lldb/source/Core/Error.cpp10
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp8
3 files changed, 30 insertions, 1 deletions
diff --git a/lldb/include/lldb/Core/Error.h b/lldb/include/lldb/Core/Error.h
index c48add8fa4e..9e45d5f555d 100644
--- a/lldb/include/lldb/Core/Error.h
+++ b/lldb/include/lldb/Core/Error.h
@@ -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:
//------------------------------------------------------------------
diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp
index 4f8c2661216..e29f12f0b2c 100644
--- a/lldb/source/Core/Error.cpp
+++ b/lldb/source/Core/Error.cpp
@@ -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;
+}
+
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 91238049058..fab0e6569d0 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -744,8 +744,14 @@ ProcessGDBRemote::ConnectToDebugserver (const char *connect_url)
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;
OpenPOWER on IntegriCloud