From 65a47b31b3958f6d4088049177d94f3e11308cd8 Mon Sep 17 00:00:00 2001 From: Ted Woodward Date: Mon, 7 Dec 2015 19:38:58 +0000 Subject: Fix watchpoint check to use watchpoint ranges Summary: Watchpoints, unlike breakpoints, have an address range. This patch changes WatchpointList::FindByAddress() to match on any address in the watchpoint range, instead of only matching on the watchpoint's base address. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14932 llvm-svn: 254931 --- lldb/source/Breakpoint/WatchpointList.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lldb/source/Breakpoint/WatchpointList.cpp') diff --git a/lldb/source/Breakpoint/WatchpointList.cpp b/lldb/source/Breakpoint/WatchpointList.cpp index 472bae06b44..64bf5cd63ed 100644 --- a/lldb/source/Breakpoint/WatchpointList.cpp +++ b/lldb/source/Breakpoint/WatchpointList.cpp @@ -75,10 +75,15 @@ WatchpointList::FindByAddress (lldb::addr_t addr) const { wp_collection::const_iterator pos, end = m_watchpoints.end(); for (pos = m_watchpoints.begin(); pos != end; ++pos) - if ((*pos)->GetLoadAddress() == addr) { + { + lldb::addr_t wp_addr = (*pos)->GetLoadAddress(); + uint32_t wp_bytesize = (*pos)->GetByteSize(); + if ((wp_addr <= addr) && ((wp_addr + wp_bytesize) > addr)) + { wp_sp = *pos; break; } + } } return wp_sp; -- cgit v1.2.3