Author: ted Date: Mon Dec 7 13:38:58 2015 New Revision: 254931 URL: http://llvm.org/viewvc/llvm-project?rev=254931&view=rev Log: 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 Modified: lldb/trunk/source/Breakpoint/WatchpointList.cpp Modified: lldb/trunk/source/Breakpoint/WatchpointList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/WatchpointList.cpp?rev=254931&r1=254930&r2=254931&view=diff ============================================================================== --- lldb/trunk/source/Breakpoint/WatchpointList.cpp (original) +++ lldb/trunk/source/Breakpoint/WatchpointList.cpp Mon Dec 7 13:38:58 2015 @@ -75,10 +75,15 @@ WatchpointList::FindByAddress (lldb::add { 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; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits