diff options
author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-10-01 05:52:16 +0000 |
---|---|---|
committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-10-01 05:52:16 +0000 |
commit | 5b5274eaf8c26064b6d10b43171f6252c10f576e (patch) | |
tree | 75f3372ba09862ae80a055d8791ad5d4830ae0e5 /lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp | |
parent | 07286cb384c48301111cdf80fc31023befc71ee6 (diff) | |
download | bcm5719-llvm-5b5274eaf8c26064b6d10b43171f6252c10f576e.tar.gz bcm5719-llvm-5b5274eaf8c26064b6d10b43171f6252c10f576e.zip |
[Windows] Added support of watchpoints to `NativeProcessWindows`
Summary: This patch adds support of watchpoints to the new `NativeProcessWindows` plugin. The same tests as in D67168 pass with these changes when the old plugin is turned off, so they will cover this functionality when the old plugin is gone.
Reviewers: asmith, amccarth, stella.stamenova, labath
Reviewed By: labath
Subscribers: labath, jfb, JDevlieghere, lldb-commits, leonid.mashinskiy
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D67222
llvm-svn: 373300
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp index 91af4c8cd72..45bdec40b40 100644 --- a/lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/NativeThreadWindows.cpp @@ -132,11 +132,30 @@ bool NativeThreadWindows::GetStopReason(ThreadStopInfo &stop_info, Status NativeThreadWindows::SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) { - return Status("unimplemented."); + if (!hardware) + return Status("not implemented"); + if (m_state == eStateLaunching) + return Status(); + Status error = RemoveWatchpoint(addr); + if (error.Fail()) + return error; + uint32_t wp_index = + m_reg_context_up->SetHardwareWatchpoint(addr, size, watch_flags); + if (wp_index == LLDB_INVALID_INDEX32) + return Status("Setting hardware watchpoint failed."); + m_watchpoint_index_map.insert({addr, wp_index}); + return Status(); } Status NativeThreadWindows::RemoveWatchpoint(lldb::addr_t addr) { - return Status("unimplemented"); + auto wp = m_watchpoint_index_map.find(addr); + if (wp == m_watchpoint_index_map.end()) + return Status(); + uint32_t wp_index = wp->second; + m_watchpoint_index_map.erase(wp); + if (m_reg_context_up->ClearHardwareWatchpoint(wp_index)) + return Status(); + return Status("Clearing hardware watchpoint failed."); } Status NativeThreadWindows::SetHardwareBreakpoint(lldb::addr_t addr, |