xref: /freebsd-src/contrib/llvm-project/lldb/source/Breakpoint/StopPointSiteList.cpp (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
1*5f757f3fSDimitry Andric //===-- StopPointSiteList.cpp ---------------------------------------------===//
2*5f757f3fSDimitry Andric //
3*5f757f3fSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*5f757f3fSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*5f757f3fSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*5f757f3fSDimitry Andric //
7*5f757f3fSDimitry Andric //===----------------------------------------------------------------------===//
8*5f757f3fSDimitry Andric 
9*5f757f3fSDimitry Andric #include "lldb/Breakpoint/StopPointSiteList.h"
10*5f757f3fSDimitry Andric #include "lldb/Breakpoint/BreakpointSite.h"
11*5f757f3fSDimitry Andric #include "lldb/Breakpoint/WatchpointResource.h"
12*5f757f3fSDimitry Andric 
13*5f757f3fSDimitry Andric #include "lldb/Utility/Stream.h"
14*5f757f3fSDimitry Andric #include <algorithm>
15*5f757f3fSDimitry Andric 
16*5f757f3fSDimitry Andric using namespace lldb;
17*5f757f3fSDimitry Andric using namespace lldb_private;
18*5f757f3fSDimitry Andric 
19*5f757f3fSDimitry Andric // This method is only defined when we're specializing for
20*5f757f3fSDimitry Andric // BreakpointSite / BreakpointLocation / Breakpoint.
21*5f757f3fSDimitry Andric // Watchpoints don't have a similar structure, they are
22*5f757f3fSDimitry Andric // WatchpointResource / Watchpoint
23*5f757f3fSDimitry Andric 
24*5f757f3fSDimitry Andric template <>
StopPointSiteContainsBreakpoint(typename BreakpointSite::SiteID site_id,lldb::break_id_t bp_id)25*5f757f3fSDimitry Andric bool StopPointSiteList<BreakpointSite>::StopPointSiteContainsBreakpoint(
26*5f757f3fSDimitry Andric     typename BreakpointSite::SiteID site_id, lldb::break_id_t bp_id) {
27*5f757f3fSDimitry Andric   std::lock_guard<std::recursive_mutex> guard(m_mutex);
28*5f757f3fSDimitry Andric   typename collection::const_iterator pos = GetIDConstIterator(site_id);
29*5f757f3fSDimitry Andric   if (pos != m_site_list.end())
30*5f757f3fSDimitry Andric     return pos->second->IsBreakpointAtThisSite(bp_id);
31*5f757f3fSDimitry Andric 
32*5f757f3fSDimitry Andric   return false;
33*5f757f3fSDimitry Andric }
34*5f757f3fSDimitry Andric 
35*5f757f3fSDimitry Andric namespace lldb_private {
36*5f757f3fSDimitry Andric template class StopPointSiteList<BreakpointSite>;
37*5f757f3fSDimitry Andric } // namespace lldb_private
38