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;


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;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to