diff options
author | Sean Callanan <scallanan@apple.com> | 2013-09-04 23:24:15 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-09-04 23:24:15 +0000 |
commit | b1de1141f127f211158409acabd75140c5bbec5a (patch) | |
tree | 236464fb4789b8546cf9e1d615d2e79aba025cf3 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 282b4492dbd9123ad4360853c1b3b4e0d26a302a (diff) | |
download | bcm5719-llvm-b1de1141f127f211158409acabd75140c5bbec5a.tar.gz bcm5719-llvm-b1de1141f127f211158409acabd75140c5bbec5a.zip |
Fixed detection of 'p' packet support in debugserver,
by appending the thread ID to the test packet when
debugserver requires it.
This allows register writing (and, by extension,
expressions) to work on Mac OS X.
llvm-svn: 190007
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 67cdbfd588a..6a53a11152d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -300,14 +300,22 @@ GDBRemoteCommunicationClient::GetVContSupported (char flavor) // Check if the target supports 'p' packet. It sends out a 'p' // packet and checks the response. A normal packet will tell us // that support is available. +// +// Takes a valid thread ID because p needs to apply to a thread. bool -GDBRemoteCommunicationClient::GetpPacketSupported () +GDBRemoteCommunicationClient::GetpPacketSupported (lldb::tid_t tid) { if (m_supports_p == eLazyBoolCalculate) { StringExtractorGDBRemote response; m_supports_p = eLazyBoolNo; - if (SendPacketAndWaitForResponse("p0", response, false)) + char packet[256]; + if (GetThreadSuffixSupported()) + snprintf(packet, sizeof(packet), "p0;thread:%" PRIx64 ";", tid); + else + snprintf(packet, sizeof(packet), "p0"); + + if (SendPacketAndWaitForResponse(packet, response, false)) { if (response.IsNormalResponse()) m_supports_p = eLazyBoolYes; |