From bdc4f12f1996a3070da0a24b469da9bf93f544dd Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 6 May 2014 02:59:39 +0000 Subject: Add GetxPacketSupported to test if the 'x' packet is supported. llvm-svn: 208052 --- .../gdb-remote/GDBRemoteCommunicationClient.cpp | 20 ++++++++++++++++++++ .../gdb-remote/GDBRemoteCommunicationClient.h | 4 ++++ 2 files changed, 24 insertions(+) (limited to 'lldb/source/Plugins/Process/gdb-remote') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index cdc51ec8a2d..0b642733414 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -67,6 +67,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient(bool is_platform) : m_attach_or_wait_reply(eLazyBoolCalculate), m_prepare_for_reg_writing_reply (eLazyBoolCalculate), m_supports_p (eLazyBoolCalculate), + m_supports_x (eLazyBoolCalculate), m_avoid_g_packets (eLazyBoolCalculate), m_supports_QSaveRegisterState (eLazyBoolCalculate), m_supports_qXfer_auxv_read (eLazyBoolCalculate), @@ -304,6 +305,7 @@ GDBRemoteCommunicationClient::ResetDiscoverableSettings() m_supports_vCont_s = eLazyBoolCalculate; m_supports_vCont_S = eLazyBoolCalculate; m_supports_p = eLazyBoolCalculate; + m_supports_x = eLazyBoolCalculate; m_supports_QSaveRegisterState = eLazyBoolCalculate; m_qHostInfo_is_valid = eLazyBoolCalculate; m_qProcessInfo_is_valid = eLazyBoolCalculate; @@ -490,6 +492,24 @@ GDBRemoteCommunicationClient::GetpPacketSupported (lldb::tid_t tid) return m_supports_p; } +bool +GDBRemoteCommunicationClient::GetxPacketSupported () +{ + if (m_supports_x == eLazyBoolCalculate) + { + StringExtractorGDBRemote response; + m_supports_x = eLazyBoolNo; + char packet[256]; + snprintf (packet, sizeof (packet), "x0,0"); + if (SendPacketAndWaitForResponse(packet, response, false) == PacketResult::Success) + { + if (response.IsOKResponse()) + m_supports_x = eLazyBoolYes; + } + } + return m_supports_x; +} + GDBRemoteCommunicationClient::PacketResult GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses ( diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 8de845fa5fe..4293e8b12d7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -282,6 +282,9 @@ public: bool GetpPacketSupported (lldb::tid_t tid); + bool + GetxPacketSupported (); + bool GetVAttachOrWaitSupported (); @@ -544,6 +547,7 @@ protected: lldb_private::LazyBool m_attach_or_wait_reply; lldb_private::LazyBool m_prepare_for_reg_writing_reply; lldb_private::LazyBool m_supports_p; + lldb_private::LazyBool m_supports_x; lldb_private::LazyBool m_avoid_g_packets; lldb_private::LazyBool m_supports_QSaveRegisterState; lldb_private::LazyBool m_supports_qXfer_auxv_read; -- cgit v1.2.3