diff options
| author | Nitesh Jain <nitesh.jain@imgtec.com> | 2016-12-09 13:54:47 +0000 |
|---|---|---|
| committer | Nitesh Jain <nitesh.jain@imgtec.com> | 2016-12-09 13:54:47 +0000 |
| commit | 0546e845c06275e0d232203eedec9b94e9528c44 (patch) | |
| tree | 9a57c1f29c9e0027714fa3500ad6b1cc3b67c25e /lldb/source | |
| parent | e51a967d8962b8d82648753d29973b2e3703359a (diff) | |
| download | bcm5719-llvm-0546e845c06275e0d232203eedec9b94e9528c44.tar.gz bcm5719-llvm-0546e845c06275e0d232203eedec9b94e9528c44.zip | |
[LLDB][MIPS] Fix TestWatchpointIter failure
Reviewers: jingham
Subscribers: jaydeep, bhushan, slthakur, lldb-commits
Differential Revision: https://reviews.llvm.org/D27124
llvm-svn: 289211
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Target/StopInfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index 6b589dd65e1..23dea41f61f 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -692,7 +692,13 @@ protected: 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 @@ protected: 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); } } } |

