summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-11-23 01:58:15 +0000
committerGreg Clayton <gclayton@apple.com>2013-11-23 01:58:15 +0000
commitfb90931b60c66f6cbaec24fb1be374146c008807 (patch)
treed65f47863e7a04397b6dbad80baf9098e0b128a3 /lldb/source/Plugins/Process
parentf0c1f59d7ef7f8e33486092bb42bc9486af8f3a0 (diff)
downloadbcm5719-llvm-fb90931b60c66f6cbaec24fb1be374146c008807.tar.gz
bcm5719-llvm-fb90931b60c66f6cbaec24fb1be374146c008807.zip
Improved platform support.
Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software). Host::MakeDirectory() now can make as many intermediate directories as needed. The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. Added a common function that can be used to create the short option string for getopt_long calls. llvm-svn: 195541
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp30
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h8
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp4
3 files changed, 33 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 8c23bcd73b0..2690992eeed 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -111,17 +111,35 @@ GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient()
bool
GDBRemoteCommunicationClient::HandshakeWithServer (Error *error_ptr)
{
+ ResetDiscoverableSettings();
+
// Start the read thread after we send the handshake ack since if we
// fail to send the handshake ack, there is no reason to continue...
if (SendAck())
- return true;
-
- if (error_ptr)
- error_ptr->SetErrorString("failed to send the handshake ack");
+ {
+ // The return value from QueryNoAckModeSupported() is true if the packet
+ // was sent and _any_ response (including UNIMPLEMENTED) was received),
+ // or false if no response was received. This quickly tells us if we have
+ // a live connection to a remote GDB server...
+ if (QueryNoAckModeSupported())
+ {
+ return true;
+ }
+ else
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("failed to get reply to handshake packet");
+ }
+ }
+ else
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("failed to send the handshake ack");
+ }
return false;
}
-void
+bool
GDBRemoteCommunicationClient::QueryNoAckModeSupported ()
{
if (m_supports_not_sending_acks == eLazyBoolCalculate)
@@ -137,8 +155,10 @@ GDBRemoteCommunicationClient::QueryNoAckModeSupported ()
m_send_acks = false;
m_supports_not_sending_acks = eLazyBoolYes;
}
+ return true;
}
}
+ return false;
}
void
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index 7d4d9a29729..564afbb2911 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -67,7 +67,13 @@ public:
bool
GetThreadSuffixSupported ();
- void
+ // This packet is usually sent first and the boolean return value
+ // indicates if the packet was send and any response was received
+ // even in the response is UNIMPLEMENTED. If the packet failed to
+ // get a response, then false is returned. This quickly tells us
+ // if we were able to connect and communicte with the remote GDB
+ // server
+ bool
QueryNoAckModeSupported ();
void
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 6618b071f54..7f1fbefc1b7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -926,15 +926,13 @@ ProcessGDBRemote::ConnectToDebugserver (const char *connect_url)
// then we aren't actually connected to anything, so try and do the
// handshake with the remote GDB server and make sure that goes
// alright.
- if (!m_gdb_comm.HandshakeWithServer (NULL))
+ if (!m_gdb_comm.HandshakeWithServer (&error))
{
m_gdb_comm.Disconnect();
if (error.Success())
error.SetErrorString("not connected to remote gdb server");
return error;
}
- m_gdb_comm.ResetDiscoverableSettings();
- m_gdb_comm.QueryNoAckModeSupported ();
m_gdb_comm.GetThreadSuffixSupported ();
m_gdb_comm.GetListThreadsInStopReplySupported ();
m_gdb_comm.GetHostInfo ();
OpenPOWER on IntegriCloud