================ @@ -53,44 +49,52 @@ bool WatchpointResource::Contains(addr_t addr) { void WatchpointResource::AddOwner(const WatchpointSP &wp_sp) { std::lock_guard<std::recursive_mutex> guard(m_owners_mutex); - m_owners.Add(wp_sp); + m_owners.push_back(wp_sp); } void WatchpointResource::RemoveOwner(WatchpointSP &wp_sp) { std::lock_guard<std::recursive_mutex> guard(m_owners_mutex); - m_owners.Remove(wp_sp); + const auto &it = std::find(m_owners.begin(), m_owners.end(), wp_sp); + if (it != m_owners.end()) + m_owners.erase(it); } size_t WatchpointResource::GetNumberOfOwners() { std::lock_guard<std::recursive_mutex> guard(m_owners_mutex); - return m_owners.GetSize(); + return m_owners.size(); } bool WatchpointResource::OwnersContains(WatchpointSP &wp_sp) { std::lock_guard<std::recursive_mutex> guard(m_owners_mutex); - return m_owners.Contains(wp_sp); + const auto &it = std::find(m_owners.begin(), m_owners.end(), wp_sp); + if (it != m_owners.end()) + return true; + return false; } bool WatchpointResource::OwnersContains(const Watchpoint *wp) { std::lock_guard<std::recursive_mutex> guard(m_owners_mutex); - return m_owners.Contains(wp); + for (WatchpointCollection::const_iterator it = m_owners.begin(); + it != m_owners.end(); ++it) + if ((*it).get() == wp) + return true; + return false; ---------------- bulbazord wrote:
`WatchpointCollection` got removed right? I think you'll need to rewrite it... I'd suggest using `find_if` https://github.com/llvm/llvm-project/pull/68845 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits