summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/RNBRemote.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-05-23 21:09:52 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-05-23 21:09:52 +0000
commit64637205051bb9789436cc4546ac9d8507a0c9d0 (patch)
treea1be9ce810e598ca64e02609fa2e2ed666c6583b /lldb/tools/debugserver/source/RNBRemote.cpp
parentafc2edbedca7a0226aadee4d45480b44e2329733 (diff)
downloadbcm5719-llvm-64637205051bb9789436cc4546ac9d8507a0c9d0.tar.gz
bcm5719-llvm-64637205051bb9789436cc4546ac9d8507a0c9d0.zip
Add the capability to display the number of supported hardware watchpoints to the "watchpoint list" command.
Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported". Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it. llvm-svn: 157345
Diffstat (limited to 'lldb/tools/debugserver/source/RNBRemote.cpp')
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 3900ab949eb..14117612ebc 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -189,6 +189,7 @@ RNBRemote::CreatePacketTable ()
t.push_back (Packet (allocate_memory, &RNBRemote::HandlePacket_AllocateMemory, NULL, "_M", "Allocate memory in the inferior process."));
t.push_back (Packet (deallocate_memory, &RNBRemote::HandlePacket_DeallocateMemory, NULL, "_m", "Deallocate memory in the inferior process."));
t.push_back (Packet (memory_region_info, &RNBRemote::HandlePacket_MemoryRegionInfo, NULL, "qMemoryRegionInfo", "Return size and attributes of a memory region that contains the given address"));
+ t.push_back (Packet (watchpoint_support_info, &RNBRemote::HandlePacket_WatchpointSupportInfo, NULL, "qWatchpointSupportInfo", "Return the number of supported hardware watchpoints"));
}
@@ -3361,6 +3362,33 @@ RNBRemote::HandlePacket_MemoryRegionInfo (const char *p)
return SendPacket (ostrm.str());
}
+rnb_err_t
+RNBRemote::HandlePacket_WatchpointSupportInfo (const char *p)
+{
+ /* This packet simply returns the number of supported hardware watchpoints.
+
+ Examples of use:
+ qWatchpointSupportInfo:
+ num:4
+
+ qWatchpointSupportInfo
+ OK // this packet is implemented by the remote nub
+ */
+
+ p += sizeof ("qWatchpointSupportInfo") - 1;
+ if (*p == '\0')
+ return SendPacket ("OK");
+ if (*p++ != ':')
+ return SendPacket ("E67");
+
+ errno = 0;
+ uint32_t num = DNBWatchpointGetNumSupportedHWP (m_ctx.ProcessID());
+ std::ostringstream ostrm;
+
+ // size:4
+ ostrm << "num:" << std::dec << num << ';';
+ return SendPacket (ostrm.str());
+}
/* 'C sig [;addr]'
Resume with signal sig, optionally at address addr. */
OpenPOWER on IntegriCloud