summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>2013-08-29 09:09:45 +0000
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>2013-08-29 09:09:45 +0000
commit9a78cdf825849463a9f2d3b6543eb6e7974fc225 (patch)
tree0f15c95da1352cdac9d38fb8738032b88ee7652f /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent0ccd3f61b14e359ce38c0b9e3f5e9ec5c4541e82 (diff)
downloadbcm5719-llvm-9a78cdf825849463a9f2d3b6543eb6e7974fc225.tar.gz
bcm5719-llvm-9a78cdf825849463a9f2d3b6543eb6e7974fc225.zip
Discover support of 'p' packet.
Some stubs only support g/G packets for registers. This change makes sure that we check if remote stub supports 'p' packet before using it. llvm-svn: 189576
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 3f702be1b57..05f2d9b31e4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -55,6 +55,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient(bool is_platform) :
m_supports_vCont_C (eLazyBoolCalculate),
m_supports_vCont_s (eLazyBoolCalculate),
m_supports_vCont_S (eLazyBoolCalculate),
+ m_supports_p (eLazyBoolCalculate),
m_qHostInfo_is_valid (eLazyBoolCalculate),
m_qProcessInfo_is_valid (eLazyBoolCalculate),
m_supports_alloc_dealloc_memory (eLazyBoolCalculate),
@@ -200,6 +201,7 @@ GDBRemoteCommunicationClient::ResetDiscoverableSettings()
m_supports_vCont_C = eLazyBoolCalculate;
m_supports_vCont_s = eLazyBoolCalculate;
m_supports_vCont_S = eLazyBoolCalculate;
+ m_supports_p = eLazyBoolCalculate;
m_qHostInfo_is_valid = eLazyBoolCalculate;
m_qProcessInfo_is_valid = eLazyBoolCalculate;
m_supports_alloc_dealloc_memory = eLazyBoolCalculate;
@@ -295,6 +297,24 @@ GDBRemoteCommunicationClient::GetVContSupported (char flavor)
return false;
}
+// 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.
+bool
+GDBRemoteCommunicationClient::GetpPacketSupported ()
+{
+ if (m_supports_p == eLazyBoolCalculate)
+ {
+ StringExtractorGDBRemote response;
+ m_supports_p = eLazyBoolNo;
+ if (SendPacketAndWaitForResponse("p0", response, false))
+ {
+ if (response.IsNormalResponse())
+ m_supports_p = eLazyBoolYes;
+ }
+ }
+ return m_supports_p;
+}
size_t
GDBRemoteCommunicationClient::SendPacketAndWaitForResponse
OpenPOWER on IntegriCloud