summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-06-17 01:22:15 +0000
committerGreg Clayton <gclayton@apple.com>2011-06-17 01:22:15 +0000
commit73bf5dbd16d91cc70da178f4bf3fecc96471f7c2 (patch)
tree0af9a600c375f2376a73be9d0f49ce8b969c6c0b /lldb/source/Plugins/Process
parent2cd8327605091d34bfcbc0a61901c7ad3bfb996c (diff)
downloadbcm5719-llvm-73bf5dbd16d91cc70da178f4bf3fecc96471f7c2.tar.gz
bcm5719-llvm-73bf5dbd16d91cc70da178f4bf3fecc96471f7c2.zip
Improved the packet throughput when debugging with GDB remote by over 3x on
darwin (not sure about other platforms). Modified the communication and connection classes to not require the BytesAvailable function. Now the "Read(...)" function has a timeout in microseconds. Fixed a lot of assertions that were firing off in certain cases and replaced them with error output and code that can deal with the assertion case. llvm-svn: 133224
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp40
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp224
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h31
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp30
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp10
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h2
6 files changed, 175 insertions, 162 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index a0ca3af3a27..517f50100b3 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -258,26 +258,40 @@ RegisterContextLLDB::InitializeNonZerothFrame()
m_current_offset_backed_up_one = -1;
addr_t cfa_regval;
int row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
- uint32_t cfa_regnum = m_full_unwind_plan_sp->GetRowForFunctionOffset(0)->GetCFARegister();
- int cfa_offset = m_full_unwind_plan_sp->GetRowForFunctionOffset(0)->GetCFAOffset();
- if (!ReadGPRValue (row_register_kind, cfa_regnum, cfa_regval))
+ const UnwindPlan::Row *row = m_full_unwind_plan_sp->GetRowForFunctionOffset(0);
+ if (row)
{
- if (log)
+ uint32_t cfa_regnum = row->GetCFARegister();
+ int cfa_offset = row->GetCFAOffset();
+ if (!ReadGPRValue (row_register_kind, cfa_regnum, cfa_regval))
{
- log->Printf("%*sFrame %u failed to get cfa value",
- m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
+ if (log)
+ {
+ log->Printf("%*sFrame %u failed to get cfa value",
+ m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
+ }
+ m_frame_type = eNormalFrame;
+ return;
}
- m_frame_type = eNormalFrame;
- return;
- }
- m_cfa = cfa_regval + cfa_offset;
+ m_cfa = cfa_regval + cfa_offset;
- // A couple of sanity checks..
- if (cfa_regval == LLDB_INVALID_ADDRESS || cfa_regval == 0 || cfa_regval == 1)
+ // A couple of sanity checks..
+ if (cfa_regval == LLDB_INVALID_ADDRESS || cfa_regval == 0 || cfa_regval == 1)
+ {
+ if (log)
+ {
+ log->Printf("%*sFrame %u could not find a valid cfa address",
+ m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
+ }
+ m_frame_type = eNotAValidFrame;
+ return;
+ }
+ }
+ else
{
if (log)
{
- log->Printf("%*sFrame %u could not find a valid cfa address",
+ log->Printf("%*sFrame %u could not find a row for function offset zero",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNotAValidFrame;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index c5e11ef33de..c2c9ddf3bfb 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -39,16 +39,12 @@ GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name,
bool is_platform) :
Communication(comm_name),
m_packet_timeout (60),
- m_rx_packet_listener (listener_name),
m_sequence_mutex (Mutex::eMutexTypeRecursive),
m_public_is_running (false),
m_private_is_running (false),
m_send_acks (true),
m_is_platform (is_platform)
{
- m_rx_packet_listener.StartListeningForEvents(this,
- Communication::eBroadcastBitPacketAvailable |
- Communication::eBroadcastBitReadThreadDidExit);
}
//----------------------------------------------------------------------
@@ -56,12 +52,8 @@ GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name,
//----------------------------------------------------------------------
GDBRemoteCommunication::~GDBRemoteCommunication()
{
- m_rx_packet_listener.StopListeningForEvents(this,
- Communication::eBroadcastBitPacketAvailable |
- Communication::eBroadcastBitReadThreadDidExit);
if (IsConnected())
{
- StopReadThread();
Disconnect();
}
}
@@ -167,7 +159,7 @@ char
GDBRemoteCommunication::GetAck ()
{
StringExtractorGDBRemote packet;
- if (WaitForPacket (packet, m_packet_timeout) == 1)
+ if (WaitForPacketWithTimeoutMicroSeconds (packet, GetPacketTimeoutInMicroSeconds ()) == 1)
return packet.GetChar();
return 0;
}
@@ -186,99 +178,63 @@ GDBRemoteCommunication::WaitForNotRunningPrivate (const TimeValue *timeout_ptr)
}
size_t
-GDBRemoteCommunication::WaitForPacket (StringExtractorGDBRemote &packet, uint32_t timeout_seconds)
+GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSeconds (StringExtractorGDBRemote &packet, uint32_t timeout_usec)
{
Mutex::Locker locker(m_sequence_mutex);
- TimeValue timeout_time;
- timeout_time = TimeValue::Now();
- timeout_time.OffsetWithSeconds (timeout_seconds);
- return WaitForPacketNoLock (packet, &timeout_time);
+ return WaitForPacketWithTimeoutMicroSecondsNoLock (packet, timeout_usec);
}
size_t
-GDBRemoteCommunication::WaitForPacket (StringExtractorGDBRemote &packet, const TimeValue* timeout_time_ptr)
+GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtractorGDBRemote &packet, uint32_t timeout_usec)
{
- Mutex::Locker locker(m_sequence_mutex);
- return WaitForPacketNoLock (packet, timeout_time_ptr);
-}
-
-size_t
-GDBRemoteCommunication::WaitForPacketNoLock (StringExtractorGDBRemote &packet, const TimeValue* timeout_time_ptr)
-{
- bool checksum_error = false;
- packet.Clear ();
+ uint8_t buffer[8192];
+ Error error;
- EventSP event_sp;
+ // Check for a packet from our cache first without trying any reading...
+ if (CheckForPacket (NULL, 0, packet))
+ return packet.GetStringRef().size();
- if (m_rx_packet_listener.WaitForEvent (timeout_time_ptr, event_sp))
+ bool timed_out = false;
+ while (IsConnected() && !timed_out)
{
- const uint32_t event_type = event_sp->GetType();
- if (event_type | Communication::eBroadcastBitPacketAvailable)
+ lldb::ConnectionStatus status;
+ size_t bytes_read = Read (buffer, sizeof(buffer), timeout_usec, status, &error);
+ if (bytes_read > 0)
{
- const EventDataBytes *event_bytes = EventDataBytes::GetEventDataFromEvent(event_sp.get());
- if (event_bytes)
- {
- const char *packet_data = (const char *)event_bytes->GetBytes();
- const uint32_t packet_size = event_bytes->GetByteSize();
- LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
- if (log)
- log->Printf ("read packet: %.*s", packet_size, packet_data);
- if (packet_data && packet_size > 0)
- {
- std::string &packet_str = packet.GetStringRef();
- if (packet_data[0] == '$')
- {
- bool success = false;
- if (packet_size < 4)
- ::fprintf (stderr, "Packet that starts with $ is too short: '%s'\n", packet_data);
- else if (packet_data[packet_size-3] != '#' ||
- !::isxdigit (packet_data[packet_size-2]) ||
- !::isxdigit (packet_data[packet_size-1]))
- ::fprintf (stderr, "Invalid checksum footer for packet: '%s'\n", packet_data);
- else
- success = true;
-
- if (success)
- packet_str.assign (packet_data + 1, packet_size - 4);
- if (GetSendAcks ())
- {
- if (success)
- {
- char packet_checksum = strtol (&packet_data[packet_size-2], NULL, 16);
- char actual_checksum = CalculcateChecksum (&packet_str[0], packet_str.size());
- checksum_error = packet_checksum != actual_checksum;
- }
- // Send the ack or nack if needed
- if (checksum_error || !success)
- SendNack();
- else
- SendAck();
- }
- }
- else
- {
- packet_str.assign (packet_data, packet_size);
- }
- return packet_str.size();
- }
- }
+ if (CheckForPacket (buffer, bytes_read, packet))
+ return packet.GetStringRef().size();
}
- else if (event_type | Communication::eBroadcastBitReadThreadDidExit)
+ else
{
- // Our read thread exited on us so just fall through and return zero...
- Disconnect();
+ switch (status)
+ {
+ case eConnectionStatusSuccess:
+ break;
+
+ case eConnectionStatusEndOfFile:
+ case eConnectionStatusNoConnection:
+ case eConnectionStatusLostConnection:
+ case eConnectionStatusError:
+ Disconnect();
+ break;
+
+ case eConnectionStatusTimedOut:
+ timed_out = true;
+ break;
+ }
}
}
+ packet.Clear ();
return 0;
}
-void
-GDBRemoteCommunication::AppendBytesToCache (const uint8_t *src, size_t src_len, bool broadcast,
- ConnectionStatus status)
+bool
+GDBRemoteCommunication::CheckForPacket (const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
{
// Put the packet data into the buffer in a thread safe fashion
Mutex::Locker locker(m_bytes_mutex);
- m_bytes.append ((const char *)src, src_len);
+ if (src && src_len > 0)
+ m_bytes.append ((const char *)src, src_len);
// Parse up the packets into gdb remote packets
while (!m_bytes.empty())
@@ -286,29 +242,40 @@ GDBRemoteCommunication::AppendBytesToCache (const uint8_t *src, size_t src_len,
// end_idx must be one past the last valid packet byte. Start
// it off with an invalid value that is the same as the current
// index.
- size_t end_idx = 0;
+ size_t content_start = 0;
+ size_t content_length = 0;
+ size_t total_length = 0;
+ size_t checksum_idx = std::string::npos;
switch (m_bytes[0])
{
case '+': // Look for ack
case '-': // Look for cancel
case '\x03': // ^C to halt target
- end_idx = 1; // The command is one byte long...
+ content_length = total_length = 1; // The command is one byte long...
break;
case '$':
// Look for a standard gdb packet?
- end_idx = m_bytes.find('#');
- if (end_idx != std::string::npos)
{
- if (end_idx + 2 < m_bytes.size())
+ size_t hash_pos = m_bytes.find('#');
+ if (hash_pos != std::string::npos)
{
- end_idx += 3;
- }
- else
- {
- // Checksum bytes aren't all here yet
- end_idx = std::string::npos;
+ if (hash_pos + 2 < m_bytes.size())
+ {
+ checksum_idx = hash_pos + 1;
+ // Skip the dollar sign
+ content_start = 1;
+ // Don't include the # in the content or the $ in the content length
+ content_length = hash_pos - 1;
+
+ total_length = hash_pos + 3; // Skip the # and the two hex checksum bytes
+ }
+ else
+ {
+ // Checksum bytes aren't all here yet
+ content_length = std::string::npos;
+ }
}
}
break;
@@ -317,27 +284,76 @@ GDBRemoteCommunication::AppendBytesToCache (const uint8_t *src, size_t src_len,
break;
}
- if (end_idx == std::string::npos)
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+ if (content_length == std::string::npos)
{
- //ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS | GDBR_LOG_VERBOSE, "GDBRemoteCommunication::%s packet not yet complete: '%s'",__FUNCTION__, m_bytes.c_str());
- return;
+ packet.Clear();
+ return false;
}
- else if (end_idx > 0)
+ else if (content_length > 0)
{
+
// We have a valid packet...
- assert (end_idx <= m_bytes.size());
- std::auto_ptr<EventDataBytes> event_bytes_ap (new EventDataBytes (&m_bytes[0], end_idx));
- ProcessGDBRemoteLog::LogIf (GDBR_LOG_COMM, "got full packet: %s", event_bytes_ap->GetBytes());
- BroadcastEvent (eBroadcastBitPacketAvailable, event_bytes_ap.release());
- m_bytes.erase(0, end_idx);
+ assert (content_length <= m_bytes.size());
+ assert (total_length <= m_bytes.size());
+ assert (content_length <= total_length);
+
+ bool success = true;
+ std::string &packet_str = packet.GetStringRef();
+ packet_str.assign (m_bytes, content_start, content_length);
+ if (m_bytes[0] == '$')
+ {
+ assert (checksum_idx < m_bytes.size());
+ if (::isxdigit (m_bytes[checksum_idx+0]) ||
+ ::isxdigit (m_bytes[checksum_idx+1]))
+ {
+ if (GetSendAcks ())
+ {
+ const char *packet_checksum_cstr = &m_bytes[checksum_idx];
+ char packet_checksum = strtol (packet_checksum_cstr, NULL, 16);
+ char actual_checksum = CalculcateChecksum (packet_str.c_str(), packet_str.size());
+ success = packet_checksum == actual_checksum;
+ if (!success)
+ {
+ if (log)
+ log->Printf ("error: checksum mismatch: %.*s expected 0x%2.2x, got 0x%2.2x",
+ (int)(total_length),
+ m_bytes.c_str(),
+ (uint8_t)packet_checksum,
+ (uint8_t)actual_checksum);
+ }
+ // Send the ack or nack if needed
+ if (!success)
+ SendNack();
+ else
+ SendAck();
+ }
+ if (success)
+ {
+ if (log)
+ log->Printf ("read packet: %.*s", (int)(total_length), m_bytes.c_str());
+ }
+ }
+ else
+ {
+ success = false;
+ if (log)
+ log->Printf ("error: invalid checksum in packet: '%s'\n", (int)(total_length), m_bytes.c_str());
+ }
+ }
+ m_bytes.erase(0, total_length);
+ packet.SetFilePos(0);
+ return success;
}
else
{
- assert (1 <= m_bytes.size());
- ProcessGDBRemoteLog::LogIf (GDBR_LOG_COMM, "GDBRemoteCommunication::%s tossing junk byte at %c",__FUNCTION__, m_bytes[0]);
+ if (log)
+ log->Printf ("GDBRemoteCommunication::%s tossing junk byte at %c",__FUNCTION__, m_bytes[0]);
m_bytes.erase(0, 1);
}
}
+ packet.Clear();
+ return false;
}
Error
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index 77e3e1a5d7c..addec5bd069 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -56,14 +56,8 @@ public:
// Wait for a packet within 'nsec' seconds
size_t
- WaitForPacket (StringExtractorGDBRemote &response,
- uint32_t sec);
-
- // Wait for a packet with an absolute timeout time. If 'timeout' is NULL
- // wait indefinitely.
- size_t
- WaitForPacket (StringExtractorGDBRemote &response,
- const lldb_private::TimeValue* timeout);
+ WaitForPacketWithTimeoutMicroSeconds (StringExtractorGDBRemote &response,
+ uint32_t usec);
char
GetAck ();
@@ -81,12 +75,10 @@ public:
bool
GetSequenceMutex(lldb_private::Mutex::Locker& locker);
- //------------------------------------------------------------------
- // Communication overrides
- //------------------------------------------------------------------
- virtual void
- AppendBytesToCache (const uint8_t *src, size_t src_len, bool broadcast, lldb::ConnectionStatus status);
-
+ bool
+ CheckForPacket (const uint8_t *src,
+ size_t src_len,
+ StringExtractorGDBRemote &packet);
bool
IsRunning() const
{
@@ -121,6 +113,11 @@ public:
return old_packet_timeout;
}
+ uint32_t
+ GetPacketTimeoutInMicroSeconds () const
+ {
+ return m_packet_timeout * USEC_PER_SEC;
+ }
//------------------------------------------------------------------
// Start a debugserver instance on the current host using the
// supplied connection URL.
@@ -130,6 +127,7 @@ public:
const char *unix_socket_name,
lldb_private::ProcessLaunchInfo &launch_info);
+
protected:
typedef std::list<std::string> packet_collection;
@@ -138,8 +136,8 @@ protected:
size_t payload_length);
size_t
- WaitForPacketNoLock (StringExtractorGDBRemote &response,
- const lldb_private::TimeValue* timeout_ptr);
+ WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtractorGDBRemote &response,
+ uint32_t timeout_usec);
bool
WaitForNotRunningPrivate (const lldb_private::TimeValue *timeout_ptr);
@@ -148,7 +146,6 @@ protected:
// Classes that inherit from GDBRemoteCommunication can see and modify these
//------------------------------------------------------------------
uint32_t m_packet_timeout;
- lldb_private::Listener m_rx_packet_listener;
lldb_private::Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time
lldb_private::Predicate<bool> m_public_is_running;
lldb_private::Predicate<bool> m_private_is_running;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index d1c51eca638..b648ac1ae1c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -68,9 +68,6 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient(bool is_platform) :
m_os_version_minor (UINT32_MAX),
m_os_version_update (UINT32_MAX)
{
- m_rx_packet_listener.StartListeningForEvents(this,
- Communication::eBroadcastBitPacketAvailable |
- Communication::eBroadcastBitReadThreadDidExit);
}
//----------------------------------------------------------------------
@@ -78,14 +75,8 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient(bool is_platform) :
//----------------------------------------------------------------------
GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient()
{
- m_rx_packet_listener.StopListeningForEvents(this,
- Communication::eBroadcastBitPacketAvailable |
- Communication::eBroadcastBitReadThreadDidExit);
if (IsConnected())
- {
- StopReadThread();
Disconnect();
- }
}
bool
@@ -94,7 +85,7 @@ GDBRemoteCommunicationClient::HandshakeWithServer (Error *error_ptr)
// 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 StartReadThread (error_ptr);
+ return true;
if (error_ptr)
error_ptr->SetErrorString("failed to send the handshake ack");
@@ -245,15 +236,12 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse
)
{
Mutex::Locker locker;
- TimeValue timeout_time;
- timeout_time = TimeValue::Now();
- timeout_time.OffsetWithSeconds (m_packet_timeout);
LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
if (GetSequenceMutex (locker))
{
if (SendPacketNoLock (payload, payload_length))
- return WaitForPacketNoLock (response, &timeout_time);
+ return WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
}
else
{
@@ -272,6 +260,10 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse
{
if (sent_interrupt)
{
+ TimeValue timeout_time;
+ timeout_time = TimeValue::Now();
+ timeout_time.OffsetWithSeconds (m_packet_timeout);
+
if (log)
log->Printf ("async: sent interrupt");
if (m_async_packet_predicate.WaitForValueEqualTo (false, &timeout_time, &timed_out))
@@ -380,7 +372,7 @@ GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse
if (log)
log->Printf ("GDBRemoteCommunicationClient::%s () WaitForPacket(%.*s)", __FUNCTION__);
- if (WaitForPacket (response, (TimeValue*)NULL))
+ if (WaitForPacketWithTimeoutMicroSeconds (response, UINT32_MAX))
{
if (response.Empty())
state = eStateInvalid;
@@ -1662,13 +1654,9 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector<lldb::tid_t> &thr
sequence_mutex_unavailable = false;
StringExtractorGDBRemote response;
- TimeValue timeout_time;
- timeout_time = TimeValue::Now();
- timeout_time.OffsetWithSeconds (m_packet_timeout*2); // We will always send at least two packets here...
-
- for (SendPacketNoLock ("qfThreadInfo", strlen("qfThreadInfo")) && WaitForPacketNoLock (response, &timeout_time);
+ for (SendPacketNoLock ("qfThreadInfo", strlen("qfThreadInfo")) && WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
response.IsNormalResponse();
- SendPacketNoLock ("qsThreadInfo", strlen("qsThreadInfo")) && WaitForPacketNoLock (response, &timeout_time))
+ SendPacketNoLock ("qsThreadInfo", strlen("qsThreadInfo")) && WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ()))
{
char ch = response.GetChar();
if (ch == 'l')
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 9379077335d..0619c107655 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -78,13 +78,13 @@ GDBRemoteCommunicationServer::~GDBRemoteCommunicationServer()
//}
//
bool
-GDBRemoteCommunicationServer::GetPacketAndSendResponse (const TimeValue* timeout_ptr,
+GDBRemoteCommunicationServer::GetPacketAndSendResponse (uint32_t timeout_usec,
Error &error,
bool &interrupt,
bool &quit)
{
StringExtractorGDBRemote packet;
- if (WaitForPacketNoLock (packet, timeout_ptr))
+ if (WaitForPacketWithTimeoutMicroSeconds(packet, timeout_usec))
{
const StringExtractorGDBRemote::ServerPacketType packet_type = packet.GetServerPacketType ();
switch (packet_type)
@@ -199,9 +199,7 @@ GDBRemoteCommunicationServer::SendOKResponse ()
bool
GDBRemoteCommunicationServer::HandshakeWithClient(Error *error_ptr)
{
- if (StartReadThread(error_ptr))
- return GetAck();
- return false;
+ return GetAck();
}
bool
@@ -517,7 +515,7 @@ AcceptPortFromInferior (void *arg)
char pid_str[256];
::memset (pid_str, 0, sizeof(pid_str));
ConnectionStatus status;
- const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), status, NULL);
+ const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), NULL, status, NULL);
if (pid_str_len > 0)
{
int pid = atoi (pid_str);
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
index 1fddaeb5fea..cce0e4e64c1 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
@@ -37,7 +37,7 @@ public:
~GDBRemoteCommunicationServer();
bool
- GetPacketAndSendResponse (const lldb_private::TimeValue* timeout_ptr,
+ GetPacketAndSendResponse (uint32_t timeout_usec,
lldb_private::Error &error,
bool &interrupt,
bool &quit);
OpenPOWER on IntegriCloud