From e9ca4af4c8b30854b54330257d7e4b3bba3ded9b Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Sat, 23 Feb 2013 02:04:45 +0000 Subject: Fix a handful of remaining assumptions that thread IDs were 32-bits in the gdb-remote Process plugin files. llvm-svn: 175947 --- .../gdb-remote/GDBRemoteCommunicationClient.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 80fa316a583..df89058d6a6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2115,17 +2115,17 @@ GDBRemoteCommunicationClient::LaunchGDBserverAndGetPort () } bool -GDBRemoteCommunicationClient::SetCurrentThread (int tid) +GDBRemoteCommunicationClient::SetCurrentThread (uint64_t tid) { if (m_curr_tid == tid) return true; - + char packet[32]; int packet_len; - if (tid <= 0) - packet_len = ::snprintf (packet, sizeof(packet), "Hg%i", tid); + if (tid == UINT64_MAX) + packet_len = ::snprintf (packet, sizeof(packet), "Hg-1"); else - packet_len = ::snprintf (packet, sizeof(packet), "Hg%x", tid); + packet_len = ::snprintf (packet, sizeof(packet), "Hg%" PRIx64, tid); assert (packet_len + 1 < sizeof(packet)); StringExtractorGDBRemote response; if (SendPacketAndWaitForResponse(packet, packet_len, response, false)) @@ -2140,18 +2140,18 @@ GDBRemoteCommunicationClient::SetCurrentThread (int tid) } bool -GDBRemoteCommunicationClient::SetCurrentThreadForRun (int tid) +GDBRemoteCommunicationClient::SetCurrentThreadForRun (uint64_t tid) { if (m_curr_tid_run == tid) return true; - + char packet[32]; int packet_len; - if (tid <= 0) - packet_len = ::snprintf (packet, sizeof(packet), "Hc%i", tid); + if (tid == UINT64_MAX) + packet_len = ::snprintf (packet, sizeof(packet), "Hc-1"); else - packet_len = ::snprintf (packet, sizeof(packet), "Hc%x", tid); - + packet_len = ::snprintf (packet, sizeof(packet), "Hc%" PRIx64, tid); + assert (packet_len + 1 < sizeof(packet)); StringExtractorGDBRemote response; if (SendPacketAndWaitForResponse(packet, packet_len, response, false)) @@ -2267,7 +2267,7 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector &thr { do { - tid_t tid = response.GetHexMaxU32(false, LLDB_INVALID_THREAD_ID); + tid_t tid = response.GetHexMaxU64(false, LLDB_INVALID_THREAD_ID); if (tid != LLDB_INVALID_THREAD_ID) { -- cgit v1.2.3