diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-05-14 00:15:32 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-05-14 00:15:32 +0000 |
commit | e24614f74e85e3b4294230888c49a2db0cb0cde6 (patch) | |
tree | 0d29cfe1e5ec4ad980b52c34489d7b353cbf94b2 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 4b0402e317cca862f8e6639f5382936b8f559324 (diff) | |
download | bcm5719-llvm-e24614f74e85e3b4294230888c49a2db0cb0cde6.tar.gz bcm5719-llvm-e24614f74e85e3b4294230888c49a2db0cb0cde6.zip |
lldb: gdb remote support always falls back to $qC when no $qProcessInfo.
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-May/003992.html
This is meant to address case 3 that I recently broke with an earlier
change to rectify usage of the $qC message for thread ids, specifically:
3. TOT lldb <=> gdbserver (without $qProcessInfo support and not Apple/iOS).
llvm-svn: 208741
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 30004202186..4c2d36904bc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1193,25 +1193,22 @@ GDBRemoteCommunicationClient::GetCurrentProcessID () } else { - // For Apple iOS targets, go back and ask the qC packet for its result. In earlier iterations of debugserver, $qC returned - // the process id of the current process. - const llvm::Triple &triple = GetProcessArchitecture().GetTriple(); - if ((triple.getVendor() == llvm::Triple::Apple) && - (triple.getOS() == llvm::Triple::IOS)) + // If we don't get a response for qProcessInfo, check if $qC gives us a result. + // $qC only returns a real process id on older debugserver and lldb-platform stubs. + // The gdb remote protocol documents $qC as returning the thread id, which newer + // debugserver and lldb-gdbserver stubs return correctly. + StringExtractorGDBRemote response; + if (SendPacketAndWaitForResponse("qC", strlen("qC"), response, false) == PacketResult::Success) { - StringExtractorGDBRemote response; - if (SendPacketAndWaitForResponse("qC", strlen("qC"), response, false) == PacketResult::Success) + if (response.GetChar() == 'Q') { - if (response.GetChar() == 'Q') + if (response.GetChar() == 'C') { - if (response.GetChar() == 'C') + m_curr_pid = response.GetHexMaxU32 (false, LLDB_INVALID_PROCESS_ID); + if (m_curr_pid != LLDB_INVALID_PROCESS_ID) { - m_curr_pid = response.GetHexMaxU32 (false, LLDB_INVALID_PROCESS_ID); - if (m_curr_pid != LLDB_INVALID_PROCESS_ID) - { - m_curr_pid_is_valid = eLazyBoolYes; - return m_curr_pid; - } + m_curr_pid_is_valid = eLazyBoolYes; + return m_curr_pid; } } } |