[Lldb-commits] [PATCH] D14932: Fix watchpoint check to use watchpoint ranges

Ted Woodward via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 23 12:48:09 PST 2015


ted created this revision.
ted added a reviewer: clayborg.
ted added a subscriber: lldb-commits.

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.

http://reviews.llvm.org/D14932

Files:
  source/Breakpoint/WatchpointList.cpp

Index: source/Breakpoint/WatchpointList.cpp
===================================================================
--- source/Breakpoint/WatchpointList.cpp
+++ source/Breakpoint/WatchpointList.cpp
@@ -75,10 +75,15 @@
     {
         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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14932.40961.patch
Type: text/x-patch
Size: 735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151123/351aa6b7/attachment.bin>


More information about the lldb-commits mailing list