[Lldb-commits] [PATCH] D27124: [LLDB][MIPS] Fix TestWatchpointIter failure

Nitesh Jain via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 9 06:05:15 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL289211: [LLDB][MIPS] Fix TestWatchpointIter failure (authored by nitesh.jain).

Changed prior to commit:
  https://reviews.llvm.org/D27124?vs=80414&id=80895#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27124

Files:
  lldb/trunk/source/Target/StopInfo.cpp


Index: lldb/trunk/source/Target/StopInfo.cpp
===================================================================
--- lldb/trunk/source/Target/StopInfo.cpp
+++ lldb/trunk/source/Target/StopInfo.cpp
@@ -692,7 +692,13 @@
             if (process_sp->GetWatchpointSupportInfo(num, wp_triggers_after)
                     .Success()) {
               if (!wp_triggers_after) {
-                process_sp->DisableWatchpoint(wp_sp.get(), false);
+                // We need to preserve the watch_index before watchpoint 
+                // is disable. Since Watchpoint::SetEnabled will clear the
+                // watch index.
+                // This will fix TestWatchpointIter failure
+                Watchpoint *wp = wp_sp.get();
+                uint32_t watch_index = wp->GetHardwareIndex();
+                process_sp->DisableWatchpoint(wp, false);
                 StopInfoSP stored_stop_info_sp = thread_sp->GetStopInfo();
                 assert(stored_stop_info_sp.get() == this);
 
@@ -710,7 +716,8 @@
                 process_sp->GetThreadList().SetSelectedThreadByID(
                     thread_sp->GetID());
                 thread_sp->SetStopInfo(stored_stop_info_sp);
-                process_sp->EnableWatchpoint(wp_sp.get(), false);
+                process_sp->EnableWatchpoint(wp, false);
+                wp->SetHardwareIndex(watch_index);
               }
             }
           }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27124.80895.patch
Type: text/x-patch
Size: 1407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161209/12acc296/attachment.bin>


More information about the lldb-commits mailing list