diff options
-rw-r--r-- | lldb/include/lldb/Breakpoint/Watchpoint.h | 13 | ||||
-rw-r--r-- | lldb/include/lldb/Target/Target.h | 3 | ||||
-rw-r--r-- | lldb/include/lldb/Utility/SharingPtr.h | 11 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 21 |
4 files changed, 46 insertions, 2 deletions
diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h index 8493775eec3..9bb03b9a91e 100644 --- a/lldb/include/lldb/Breakpoint/Watchpoint.h +++ b/lldb/include/lldb/Breakpoint/Watchpoint.h @@ -205,7 +205,18 @@ private: friend class Target; friend class WatchpointList; - void ResetHitCount() { m_hit_count = 0; } + void + ResetHitCount () + { + m_hit_count = 0; + } + + void + ResetHistoricValues () + { + m_old_value_sp.reset(nullptr); + m_new_value_sp.reset(nullptr); + } Target &m_target; bool m_enabled; // Is this watchpoint enabled diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 7ec197cdd94..e9389cfbc08 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -783,6 +783,9 @@ public: ClearAllWatchpointHitCounts (); bool + ClearAllWatchpointHistoricValues (); + + bool IgnoreAllWatchpoints (uint32_t ignore_count); bool diff --git a/lldb/include/lldb/Utility/SharingPtr.h b/lldb/include/lldb/Utility/SharingPtr.h index 1b5f86bbe2d..5c77dad9f7f 100644 --- a/lldb/include/lldb/Utility/SharingPtr.h +++ b/lldb/include/lldb/Utility/SharingPtr.h @@ -154,6 +154,7 @@ public: void swap(SharingPtr& r); void reset(); template<class Y> void reset(Y* p); + void reset(std::nullptr_t); element_type* get() const {return ptr_;} element_type& operator*() const {return *ptr_;} @@ -295,6 +296,14 @@ SharingPtr<T>::reset() } template<class T> +inline +void +SharingPtr<T>::reset (std::nullptr_t p) +{ + reset(); +} + +template<class T> template<class Y> inline void @@ -547,7 +556,7 @@ public: if (cb_) cb_(baton_, *this, false); } - + void SetCallback(Callback cb, void* baton) { cb_ = cb; diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 4d530557324..8ea6942c2f0 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -175,6 +175,7 @@ Target::CleanupProcess () this->GetWatchpointList().GetListMutex(locker); DisableAllWatchpoints(false); ClearAllWatchpointHitCounts(); + ClearAllWatchpointHistoricValues(); } void @@ -907,6 +908,26 @@ Target::ClearAllWatchpointHitCounts () return true; // Success! } +// Assumption: Caller holds the list mutex lock for m_watchpoint_list. +bool +Target::ClearAllWatchpointHistoricValues () +{ + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_WATCHPOINTS)); + if (log) + log->Printf ("Target::%s\n", __FUNCTION__); + + size_t num_watchpoints = m_watchpoint_list.GetSize(); + for (size_t i = 0; i < num_watchpoints; ++i) + { + WatchpointSP wp_sp = m_watchpoint_list.GetByIndex(i); + if (!wp_sp) + return false; + + wp_sp->ResetHistoricValues(); + } + return true; // Success! +} + // Assumption: Caller holds the list mutex lock for m_watchpoint_list // during these operations. bool |