From 6179c0eb0d15d73e11af8b6b5538b381c6ed2c53 Mon Sep 17 00:00:00 2001 From: Aleksandr Urakov Date: Fri, 6 Sep 2019 05:37:03 +0000 Subject: [Windows] Add support of watchpoints to `ProcessWindows` Summary: This patch adds support of watchpoints to the old `ProcessWindows` plugin. The `ProcessWindows` plugin uses the `RegisterContext` to set and reset watchpoints. The `RegisterContext` has some interface to access watchpoints, but it is very limited (e.g. it is impossible to retrieve the last triggered watchpoint with it), that's why I have implemented a slightly different interface in the `RegisterContextWindows`. Moreover, I have made the `ProcessWindows` plugin responsible for search of a vacant watchpoint slot, because watchpoints exist per-process (not per-thread), then we can place the same watchpoint in the same slot in different threads. With this scheme threads don't need to have their own watchpoint lists, and it simplifies identifying of the last triggered watchpoint. Reviewers: asmith, stella.stamenova, amccarth Reviewed By: amccarth Subscribers: labath, zturner, leonid.mashinskiy, abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67168 llvm-svn: 371166 --- .../Plugins/Process/Windows/Common/ProcessWindows.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h') diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h index 8d5134a49a4..a1085df022c 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -98,6 +98,22 @@ public: void OnUnloadDll(lldb::addr_t module_addr) override; void OnDebugString(const std::string &string) override; void OnDebuggerError(const Status &error, uint32_t type) override; + + Status GetWatchpointSupportInfo(uint32_t &num) override; + Status GetWatchpointSupportInfo(uint32_t &num, bool &after) override; + Status EnableWatchpoint(Watchpoint *wp, bool notify = true) override; + Status DisableWatchpoint(Watchpoint *wp, bool notify = true) override; + +private: + struct WatchpointInfo { + uint32_t slot_id; + lldb::addr_t address; + uint32_t size; + bool read; + bool write; + }; + std::map m_watchpoints; + std::vector m_watchpoint_ids; }; } // namespace lldb_private -- cgit v1.2.3