diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
3 files changed, 12 insertions, 4 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; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index fc317be2a20..535a69c248e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -228,7 +228,7 @@ public: GetVContSupported (char flavor); bool - GetpPacketSupported (); + GetpPacketSupported (lldb::tid_t tid); bool GetVAttachOrWaitSupported (); diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index b405f03463c..cce5a599566 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -177,7 +177,7 @@ ThreadGDBRemote::CreateRegisterContextForFrame (StackFrame *frame) { ProcessGDBRemote *gdb_process = static_cast<ProcessGDBRemote *>(process_sp.get()); // read_all_registers_at_once will be true if 'p' packet is not supported. - bool read_all_registers_at_once = !gdb_process->GetGDBRemote().GetpPacketSupported (); + bool read_all_registers_at_once = !gdb_process->GetGDBRemote().GetpPacketSupported (GetID()); reg_ctx_sp.reset (new GDBRemoteRegisterContext (*this, concrete_frame_idx, gdb_process->m_register_info, read_all_registers_at_once)); } } |