1 //===-- BreakpointLocationCollection.h --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_BreakpointLocationCollection_h_
11 #define liblldb_BreakpointLocationCollection_h_
16 // Other libraries and framework includes
18 #include "lldb/lldb-private.h"
20 namespace lldb_private {
22 class BreakpointLocationCollection
25 BreakpointLocationCollection();
27 ~BreakpointLocationCollection();
29 //------------------------------------------------------------------
30 /// Add the breakpoint \a bp_loc_sp to the list.
33 /// Shared pointer to the breakpoint location that will get added
37 /// Returns breakpoint location id.
38 //------------------------------------------------------------------
40 Add (const lldb::BreakpointLocationSP& bp_loc_sp);
42 //------------------------------------------------------------------
43 /// Removes the breakpoint location given by \b breakID from this
46 /// @param[in] break_id
47 /// The breakpoint index to remove.
49 /// @param[in] break_loc_id
50 /// The breakpoint location index in break_id to remove.
53 /// \b true if the breakpoint was in the list.
54 //------------------------------------------------------------------
56 Remove (lldb::break_id_t break_id, lldb::break_id_t break_loc_id);
58 //------------------------------------------------------------------
59 /// Returns a shared pointer to the breakpoint location with id \a
62 /// @param[in] break_id
63 /// The breakpoint ID to seek for.
65 /// @param[in] break_loc_id
66 /// The breakpoint location ID in \a break_id to seek for.
69 /// A shared pointer to the breakpoint. May contain a NULL
70 /// pointer if the breakpoint doesn't exist.
71 //------------------------------------------------------------------
72 lldb::BreakpointLocationSP
73 FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id);
75 //------------------------------------------------------------------
76 /// Returns a shared pointer to the breakpoint location with id \a
77 /// breakID, const version.
79 /// @param[in] breakID
80 /// The breakpoint location ID to seek for.
82 /// @param[in] break_loc_id
83 /// The breakpoint location ID in \a break_id to seek for.
86 /// A shared pointer to the breakpoint. May contain a NULL
87 /// pointer if the breakpoint doesn't exist.
88 //------------------------------------------------------------------
89 const lldb::BreakpointLocationSP
90 FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const;
92 //------------------------------------------------------------------
93 /// Returns a shared pointer to the breakpoint location with index
97 /// The breakpoint location index to seek for.
100 /// A shared pointer to the breakpoint. May contain a NULL
101 /// pointer if the breakpoint doesn't exist.
102 //------------------------------------------------------------------
103 lldb::BreakpointLocationSP
104 GetByIndex (size_t i);
106 //------------------------------------------------------------------
107 /// Returns a shared pointer to the breakpoint location with index
108 /// \a i, const version.
111 /// The breakpoint location index to seek for.
114 /// A shared pointer to the breakpoint. May contain a NULL
115 /// pointer if the breakpoint doesn't exist.
116 //------------------------------------------------------------------
117 const lldb::BreakpointLocationSP
118 GetByIndex (size_t i) const;
120 //------------------------------------------------------------------
121 /// Returns the number of elements in this breakpoint location list.
124 /// The number of elements.
125 //------------------------------------------------------------------
127 GetSize() const { return m_break_loc_collection.size(); }
129 //------------------------------------------------------------------
130 /// Enquires of all the breakpoint locations in this list whether
131 /// we should stop at a hit at \a breakID.
133 /// @param[in] context
134 /// This contains the information about this stop.
136 /// @param[in] breakID
137 /// This break ID that we hit.
140 /// \b true if we should stop, \b false otherwise.
141 //------------------------------------------------------------------
143 ShouldStop (StoppointCallbackContext *context);
145 //------------------------------------------------------------------
146 /// Print a description of the breakpoint locations in this list
147 /// to the stream \a s.
150 /// The stream to which to print the description.
153 /// The description level that indicates the detail level to
156 /// @see lldb::DescriptionLevel
157 //------------------------------------------------------------------
158 void GetDescription (Stream *s, lldb::DescriptionLevel level);
160 //------------------------------------------------------------------
161 /// Check whether this collection of breakpoint locations have any
162 /// thread specifiers, and if yes, is \a thread_id contained in any
163 /// of these specifiers.
165 /// @param[in] thread
166 /// The thread against which to test.
169 /// \b true if the collection contains at least one location that
170 /// would be valid for this thread, false otherwise.
171 //------------------------------------------------------------------
172 bool ValidForThisThread (Thread *thread);
174 //------------------------------------------------------------------
175 /// Tell whether ALL the breakpoints in the location collection are internal.
178 /// \b true if all breakpoint locations are owned by internal breakpoints,
179 /// \b false otherwise.
180 //------------------------------------------------------------------
181 bool IsInternal() const;
185 //------------------------------------------------------------------
186 // Classes that inherit from BreakpointLocationCollection can see
188 //------------------------------------------------------------------
191 //------------------------------------------------------------------
192 // For BreakpointLocationCollection only
193 //------------------------------------------------------------------
195 typedef std::vector<lldb::BreakpointLocationSP> collection;
198 GetIDPairIterator(lldb::break_id_t break_id, lldb::break_id_t break_loc_id);
200 collection::const_iterator
201 GetIDPairConstIterator(lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const;
203 collection m_break_loc_collection;
207 } // namespace lldb_private
209 #endif // liblldb_BreakpointLocationCollection_h_