1 //===-- Breakpoint.h --------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_BREAKPOINT_BREAKPOINT_H
10 #define LLDB_BREAKPOINT_BREAKPOINT_H
11 
12 #include <memory>
13 #include <string>
14 #include <unordered_set>
15 #include <vector>
16 
17 #include "lldb/Breakpoint/BreakpointID.h"
18 #include "lldb/Breakpoint/BreakpointLocationCollection.h"
19 #include "lldb/Breakpoint/BreakpointLocationList.h"
20 #include "lldb/Breakpoint/BreakpointName.h"
21 #include "lldb/Breakpoint/BreakpointOptions.h"
22 #include "lldb/Breakpoint/Stoppoint.h"
23 #include "lldb/Breakpoint/StoppointHitCounter.h"
24 #include "lldb/Core/SearchFilter.h"
25 #include "lldb/Target/Statistics.h"
26 #include "lldb/Utility/Event.h"
27 #include "lldb/Utility/StringList.h"
28 #include "lldb/Utility/StructuredData.h"
29 
30 namespace lldb_private {
31 
32 /// \class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h" Class that
33 /// manages logical breakpoint setting.
34 
35 /// General Outline:
36 /// A breakpoint has four main parts, a filter, a resolver, the list of
37 /// breakpoint
38 /// locations that have been determined for the filter/resolver pair, and
39 /// finally a set of options for the breakpoint.
40 ///
41 /// \b Filter:
42 /// This is an object derived from SearchFilter.  It manages the search for
43 /// breakpoint location matches through the symbols in the module list of the
44 /// target that owns it.  It also filters out locations based on whatever
45 /// logic it wants.
46 ///
47 /// \b Resolver:
48 /// This is an object derived from BreakpointResolver.  It provides a callback
49 /// to the filter that will find breakpoint locations.  How it does this is
50 /// determined by what kind of resolver it is.
51 ///
52 /// The Breakpoint class also provides constructors for the common breakpoint
53 /// cases which make the appropriate filter and resolver for you.
54 ///
55 /// \b Location List:
56 /// This stores the breakpoint locations that have been determined to date.
57 /// For a given breakpoint, there will be only one location with a given
58 /// address.  Adding a location at an already taken address will just return
59 /// the location already at that address.  Locations can be looked up by ID,
60 /// or by address.
61 ///
62 /// \b Options:
63 /// This includes:
64 ///    \b Enabled/Disabled
65 ///    \b Ignore Count
66 ///    \b Callback
67 ///    \b Condition
68 /// Note, these options can be set on the breakpoint, and they can also be set
69 /// on the individual locations.  The options set on the breakpoint take
70 /// precedence over the options set on the individual location. So for
71 /// instance disabling the breakpoint will cause NONE of the locations to get
72 /// hit. But if the breakpoint is enabled, then the location's enabled state
73 /// will be checked to determine whether to insert that breakpoint location.
74 /// Similarly, if the breakpoint condition says "stop", we won't check the
75 /// location's condition. But if the breakpoint condition says "continue",
76 /// then we will check the location for whether to actually stop or not. One
77 /// subtle point worth observing here is that you don't actually stop at a
78 /// Breakpoint, you always stop at one of its locations.  So the "should stop"
79 /// tests are done by the location, not by the breakpoint.
80 class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
81                    public Stoppoint {
82 public:
83   static ConstString GetEventIdentifier();
84   static const char *
85       BreakpointEventTypeAsCString(lldb::BreakpointEventType type);
86 
87   /// An enum specifying the match style for breakpoint settings.  At present
88   /// only used for function name style breakpoints.
89   enum MatchType { Exact, Regexp, Glob };
90 
91 private:
92   enum class OptionNames : uint32_t { Names = 0, Hardware, LastOptionName };
93 
94   static const char
95       *g_option_names[static_cast<uint32_t>(OptionNames::LastOptionName)];
96 
97   static const char *GetKey(OptionNames enum_value) {
98     return g_option_names[static_cast<uint32_t>(enum_value)];
99   }
100 
101 public:
102   class BreakpointEventData : public EventData {
103   public:
104     BreakpointEventData(lldb::BreakpointEventType sub_type,
105                         const lldb::BreakpointSP &new_breakpoint_sp);
106 
107     ~BreakpointEventData() override;
108 
109     static ConstString GetFlavorString();
110 
111     Log *GetLogChannel() override;
112 
113     ConstString GetFlavor() const override;
114 
115     lldb::BreakpointEventType GetBreakpointEventType() const;
116 
117     lldb::BreakpointSP GetBreakpoint() const;
118 
119     BreakpointLocationCollection &GetBreakpointLocationCollection() {
120       return m_locations;
121     }
122 
123     void Dump(Stream *s) const override;
124 
125     static lldb::BreakpointEventType
126     GetBreakpointEventTypeFromEvent(const lldb::EventSP &event_sp);
127 
128     static lldb::BreakpointSP
129     GetBreakpointFromEvent(const lldb::EventSP &event_sp);
130 
131     static lldb::BreakpointLocationSP
132     GetBreakpointLocationAtIndexFromEvent(const lldb::EventSP &event_sp,
133                                           uint32_t loc_idx);
134 
135     static size_t
136     GetNumBreakpointLocationsFromEvent(const lldb::EventSP &event_sp);
137 
138     static const BreakpointEventData *
139     GetEventDataFromEvent(const Event *event_sp);
140 
141   private:
142     lldb::BreakpointEventType m_breakpoint_event;
143     lldb::BreakpointSP m_new_breakpoint_sp;
144     BreakpointLocationCollection m_locations;
145 
146     BreakpointEventData(const BreakpointEventData &) = delete;
147     const BreakpointEventData &operator=(const BreakpointEventData &) = delete;
148   };
149 
150   // Saving & restoring breakpoints:
151   static lldb::BreakpointSP CreateFromStructuredData(
152       lldb::TargetSP target_sp, StructuredData::ObjectSP &data_object_sp,
153       Status &error);
154 
155   static bool
156   SerializedBreakpointMatchesNames(StructuredData::ObjectSP &bkpt_object_sp,
157                                    std::vector<std::string> &names);
158 
159   virtual StructuredData::ObjectSP SerializeToStructuredData();
160 
161   static const char *GetSerializationKey() { return "Breakpoint"; }
162   /// Destructor.
163   ///
164   /// The destructor is not virtual since there should be no reason to
165   /// subclass breakpoints.  The varieties of breakpoints are specified
166   /// instead by providing different resolvers & filters.
167   ~Breakpoint() override;
168 
169   // Methods
170 
171   /// Tell whether this breakpoint is an "internal" breakpoint. \return
172   ///     Returns \b true if this is an internal breakpoint, \b false otherwise.
173   bool IsInternal() const;
174 
175   /// Standard "Dump" method.  At present it does nothing.
176   void Dump(Stream *s) override;
177 
178   // The next set of methods provide ways to tell the breakpoint to update it's
179   // location list - usually done when modules appear or disappear.
180 
181   /// Tell this breakpoint to clear all its breakpoint sites.  Done when the
182   /// process holding the breakpoint sites is destroyed.
183   void ClearAllBreakpointSites();
184 
185   /// Tell this breakpoint to scan it's target's module list and resolve any
186   /// new locations that match the breakpoint's specifications.
187   void ResolveBreakpoint();
188 
189   /// Tell this breakpoint to scan a given module list and resolve any new
190   /// locations that match the breakpoint's specifications.
191   ///
192   /// \param[in] module_list
193   ///    The list of modules to look in for new locations.
194   ///
195   /// \param[in]  send_event
196   ///     If \b true, send a breakpoint location added event for non-internal
197   ///     breakpoints.
198   void ResolveBreakpointInModules(ModuleList &module_list,
199                                   bool send_event = true);
200 
201   /// Tell this breakpoint to scan a given module list and resolve any new
202   /// locations that match the breakpoint's specifications.
203   ///
204   /// \param[in] module_list
205   ///    The list of modules to look in for new locations.
206   ///
207   /// \param[in]  new_locations
208   ///     Fills new_locations with the new locations that were made.
209   void ResolveBreakpointInModules(ModuleList &module_list,
210                                   BreakpointLocationCollection &new_locations);
211 
212   /// Like ResolveBreakpointInModules, but allows for "unload" events, in
213   /// which case we will remove any locations that are in modules that got
214   /// unloaded.
215   ///
216   /// \param[in] changed_modules
217   ///    The list of modules to look in for new locations.
218   /// \param[in] load_event
219   ///    If \b true then the modules were loaded, if \b false, unloaded.
220   /// \param[in] delete_locations
221   ///    If \b true then the modules were unloaded delete any locations in the
222   ///    changed modules.
223   void ModulesChanged(ModuleList &changed_modules, bool load_event,
224                       bool delete_locations = false);
225 
226   /// Tells the breakpoint the old module \a old_module_sp has been replaced
227   /// by new_module_sp (usually because the underlying file has been rebuilt,
228   /// and the old version is gone.)
229   ///
230   /// \param[in] old_module_sp
231   ///    The old module that is going away.
232   /// \param[in] new_module_sp
233   ///    The new module that is replacing it.
234   void ModuleReplaced(lldb::ModuleSP old_module_sp,
235                       lldb::ModuleSP new_module_sp);
236 
237   // The next set of methods provide access to the breakpoint locations for
238   // this breakpoint.
239 
240   /// Add a location to the breakpoint's location list.  This is only meant to
241   /// be called by the breakpoint's resolver.  FIXME: how do I ensure that?
242   ///
243   /// \param[in] addr
244   ///    The Address specifying the new location.
245   /// \param[out] new_location
246   ///    Set to \b true if a new location was created, to \b false if there
247   ///    already was a location at this Address.
248   /// \return
249   ///    Returns a pointer to the new location.
250   lldb::BreakpointLocationSP AddLocation(const Address &addr,
251                                          bool *new_location = nullptr);
252 
253   /// Find a breakpoint location by Address.
254   ///
255   /// \param[in] addr
256   ///    The Address specifying the location.
257   /// \return
258   ///    Returns a shared pointer to the location at \a addr.  The pointer
259   ///    in the shared pointer will be nullptr if there is no location at that
260   ///    address.
261   lldb::BreakpointLocationSP FindLocationByAddress(const Address &addr);
262 
263   /// Find a breakpoint location ID by Address.
264   ///
265   /// \param[in] addr
266   ///    The Address specifying the location.
267   /// \return
268   ///    Returns the UID of the location at \a addr, or \b LLDB_INVALID_ID if
269   ///    there is no breakpoint location at that address.
270   lldb::break_id_t FindLocationIDByAddress(const Address &addr);
271 
272   /// Find a breakpoint location for a given breakpoint location ID.
273   ///
274   /// \param[in] bp_loc_id
275   ///    The ID specifying the location.
276   /// \return
277   ///    Returns a shared pointer to the location with ID \a bp_loc_id.  The
278   ///    pointer
279   ///    in the shared pointer will be nullptr if there is no location with that
280   ///    ID.
281   lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id);
282 
283   /// Get breakpoint locations by index.
284   ///
285   /// \param[in] index
286   ///    The location index.
287   ///
288   /// \return
289   ///     Returns a shared pointer to the location with index \a
290   ///     index. The shared pointer might contain nullptr if \a index is
291   ///     greater than then number of actual locations.
292   lldb::BreakpointLocationSP GetLocationAtIndex(size_t index);
293 
294   /// Removes all invalid breakpoint locations.
295   ///
296   /// Removes all breakpoint locations with architectures that aren't
297   /// compatible with \a arch. Also remove any breakpoint locations with whose
298   /// locations have address where the section has been deleted (module and
299   /// object files no longer exist).
300   ///
301   /// This is typically used after the process calls exec, or anytime the
302   /// architecture of the target changes.
303   ///
304   /// \param[in] arch
305   ///     If valid, check the module in each breakpoint to make sure
306   ///     they are compatible, otherwise, ignore architecture.
307   void RemoveInvalidLocations(const ArchSpec &arch);
308 
309   // The next section deals with various breakpoint options.
310 
311   /// If \a enable is \b true, enable the breakpoint, if \b false disable it.
312   void SetEnabled(bool enable) override;
313 
314   /// Check the Enable/Disable state.
315   /// \return
316   ///     \b true if the breakpoint is enabled, \b false if disabled.
317   bool IsEnabled() override;
318 
319   /// Set the breakpoint to ignore the next \a count breakpoint hits.
320   /// \param[in] count
321   ///    The number of breakpoint hits to ignore.
322   void SetIgnoreCount(uint32_t count);
323 
324   /// Return the current ignore count/
325   /// \return
326   ///     The number of breakpoint hits to be ignored.
327   uint32_t GetIgnoreCount() const;
328 
329   /// Return the current hit count for all locations. \return
330   ///     The current hit count for all locations.
331   uint32_t GetHitCount() const;
332 
333   /// If \a one_shot is \b true, breakpoint will be deleted on first hit.
334   void SetOneShot(bool one_shot);
335 
336   /// Check the OneShot state.
337   /// \return
338   ///     \b true if the breakpoint is one shot, \b false otherwise.
339   bool IsOneShot() const;
340 
341   /// If \a auto_continue is \b true, breakpoint will auto-continue when on
342   /// hit.
343   void SetAutoContinue(bool auto_continue);
344 
345   /// Check the AutoContinue state.
346   /// \return
347   ///     \b true if the breakpoint is set to auto-continue, \b false otherwise.
348   bool IsAutoContinue() const;
349 
350   /// Set the valid thread to be checked when the breakpoint is hit.
351   /// \param[in] thread_id
352   ///    If this thread hits the breakpoint, we stop, otherwise not.
353   void SetThreadID(lldb::tid_t thread_id);
354 
355   /// Return the current stop thread value.
356   /// \return
357   ///     The thread id for which the breakpoint hit will stop,
358   ///     LLDB_INVALID_THREAD_ID for all threads.
359   lldb::tid_t GetThreadID() const;
360 
361   void SetThreadIndex(uint32_t index);
362 
363   uint32_t GetThreadIndex() const;
364 
365   void SetThreadName(const char *thread_name);
366 
367   const char *GetThreadName() const;
368 
369   void SetQueueName(const char *queue_name);
370 
371   const char *GetQueueName() const;
372 
373   /// Set the callback action invoked when the breakpoint is hit.
374   ///
375   /// \param[in] callback
376   ///    The method that will get called when the breakpoint is hit.
377   /// \param[in] baton
378   ///    A void * pointer that will get passed back to the callback function.
379   /// \param[in] is_synchronous
380   ///    If \b true the callback will be run on the private event thread
381   ///    before the stop event gets reported.  If false, the callback will get
382   ///    handled on the public event thread after the stop has been posted.
383   void SetCallback(BreakpointHitCallback callback, void *baton,
384                    bool is_synchronous = false);
385 
386   void SetCallback(BreakpointHitCallback callback,
387                    const lldb::BatonSP &callback_baton_sp,
388                    bool is_synchronous = false);
389 
390   void ClearCallback();
391 
392   /// Set the breakpoint's condition.
393   ///
394   /// \param[in] condition
395   ///    The condition expression to evaluate when the breakpoint is hit.
396   ///    Pass in nullptr to clear the condition.
397   void SetCondition(const char *condition);
398 
399   /// Return a pointer to the text of the condition expression.
400   ///
401   /// \return
402   ///    A pointer to the condition expression text, or nullptr if no
403   //     condition has been set.
404   const char *GetConditionText() const;
405 
406   // The next section are various utility functions.
407 
408   /// Return the number of breakpoint locations that have resolved to actual
409   /// breakpoint sites.
410   ///
411   /// \return
412   ///     The number locations resolved breakpoint sites.
413   size_t GetNumResolvedLocations() const;
414 
415   /// Return whether this breakpoint has any resolved locations.
416   ///
417   /// \return
418   ///     True if GetNumResolvedLocations > 0
419   bool HasResolvedLocations() const;
420 
421   /// Return the number of breakpoint locations.
422   ///
423   /// \return
424   ///     The number breakpoint locations.
425   size_t GetNumLocations() const;
426 
427   /// Put a description of this breakpoint into the stream \a s.
428   ///
429   /// \param[in] s
430   ///     Stream into which to dump the description.
431   ///
432   /// \param[in] level
433   ///     The description level that indicates the detail level to
434   ///     provide.
435   ///
436   /// \see lldb::DescriptionLevel
437   void GetDescription(Stream *s, lldb::DescriptionLevel level,
438                       bool show_locations = false);
439 
440   /// Set the "kind" description for a breakpoint.  If the breakpoint is hit
441   /// the stop info will show this "kind" description instead of the
442   /// breakpoint number.  Mostly useful for internal breakpoints, where the
443   /// breakpoint number doesn't have meaning to the user.
444   ///
445   /// \param[in] kind
446   ///     New "kind" description.
447   void SetBreakpointKind(const char *kind) { m_kind_description.assign(kind); }
448 
449   /// Return the "kind" description for a breakpoint.
450   ///
451   /// \return
452   ///     The breakpoint kind, or nullptr if none is set.
453   const char *GetBreakpointKind() const { return m_kind_description.c_str(); }
454 
455   /// Accessor for the breakpoint Target.
456   /// \return
457   ///     This breakpoint's Target.
458   Target &GetTarget() { return m_target; }
459 
460   const Target &GetTarget() const { return m_target; }
461 
462   const lldb::TargetSP GetTargetSP();
463 
464   void GetResolverDescription(Stream *s);
465 
466   /// Find breakpoint locations which match the (filename, line_number)
467   /// description. The breakpoint location collection is to be filled with the
468   /// matching locations. It should be initialized with 0 size by the API
469   /// client.
470   ///
471   /// \return
472   ///     True if there is a match
473   ///
474   ///     The locations which match the filename and line_number in loc_coll.
475   ///     If its
476   ///     size is 0 and true is returned, it means the breakpoint fully matches
477   ///     the
478   ///     description.
479   bool GetMatchingFileLine(ConstString filename, uint32_t line_number,
480                            BreakpointLocationCollection &loc_coll);
481 
482   void GetFilterDescription(Stream *s);
483 
484   /// Returns the BreakpointOptions structure set at the breakpoint level.
485   ///
486   /// Meant to be used by the BreakpointLocation class.
487   ///
488   /// \return
489   ///     A reference to this breakpoint's BreakpointOptions.
490   BreakpointOptions &GetOptions();
491 
492   /// Returns the BreakpointOptions structure set at the breakpoint level.
493   ///
494   /// Meant to be used by the BreakpointLocation class.
495   ///
496   /// \return
497   ///     A reference to this breakpoint's BreakpointOptions.
498   const BreakpointOptions &GetOptions() const;
499 
500   /// Invoke the callback action when the breakpoint is hit.
501   ///
502   /// Meant to be used by the BreakpointLocation class.
503   ///
504   /// \param[in] context
505   ///     Described the breakpoint event.
506   ///
507   /// \param[in] bp_loc_id
508   ///     Which breakpoint location hit this breakpoint.
509   ///
510   /// \return
511   ///     \b true if the target should stop at this breakpoint and \b false not.
512   bool InvokeCallback(StoppointCallbackContext *context,
513                       lldb::break_id_t bp_loc_id);
514 
515   bool IsHardware() const { return m_hardware; }
516 
517   lldb::BreakpointResolverSP GetResolver() { return m_resolver_sp; }
518 
519   lldb::SearchFilterSP GetSearchFilter() { return m_filter_sp; }
520 
521 private: // The target needs to manage adding & removing names.  It will do the
522          // checking for name validity as well.
523   bool AddName(llvm::StringRef new_name);
524 
525   void RemoveName(const char *name_to_remove) {
526     if (name_to_remove)
527       m_name_list.erase(name_to_remove);
528   }
529 
530 public:
531   bool MatchesName(const char *name) {
532     return m_name_list.find(name) != m_name_list.end();
533   }
534 
535   void GetNames(std::vector<std::string> &names) {
536     names.clear();
537     for (auto name : m_name_list) {
538       names.push_back(name);
539     }
540   }
541 
542   /// Set a pre-condition filter that overrides all user provided
543   /// filters/callbacks etc.
544   ///
545   /// Used to define fancy breakpoints that can do dynamic hit detection
546   /// without taking up the condition slot - which really belongs to the user
547   /// anyway...
548   ///
549   /// The Precondition should not continue the target, it should return true
550   /// if the condition says to stop and false otherwise.
551   ///
552   void SetPrecondition(lldb::BreakpointPreconditionSP precondition_sp) {
553     m_precondition_sp = std::move(precondition_sp);
554   }
555 
556   bool EvaluatePrecondition(StoppointCallbackContext &context);
557 
558   lldb::BreakpointPreconditionSP GetPrecondition() { return m_precondition_sp; }
559 
560   // Produces the OR'ed values for all the names assigned to this breakpoint.
561   const BreakpointName::Permissions &GetPermissions() const {
562       return m_permissions;
563   }
564 
565   BreakpointName::Permissions &GetPermissions() {
566       return m_permissions;
567   }
568 
569   bool AllowList() const {
570     return GetPermissions().GetAllowList();
571   }
572   bool AllowDisable() const {
573     return GetPermissions().GetAllowDisable();
574   }
575   bool AllowDelete() const {
576     return GetPermissions().GetAllowDelete();
577   }
578 
579   // This one should only be used by Target to copy breakpoints from target to
580   // target - primarily from the dummy target to prime new targets.
581   static lldb::BreakpointSP CopyFromBreakpoint(lldb::TargetSP new_target,
582       const Breakpoint &bp_to_copy_from);
583 
584   /// Get statistics associated with this breakpoint in JSON format.
585   llvm::json::Value GetStatistics();
586 
587   /// Get the time it took to resolve all locations in this breakpoint.
588   StatsDuration::Duration GetResolveTime() const { return m_resolve_time; }
589 
590 protected:
591   friend class Target;
592   // Protected Methods
593 
594   /// Constructors and Destructors
595   /// Only the Target can make a breakpoint, and it owns the breakpoint
596   /// lifespans. The constructor takes a filter and a resolver.  Up in Target
597   /// there are convenience variants that make breakpoints for some common
598   /// cases.
599   ///
600   /// \param[in] target
601   ///    The target in which the breakpoint will be set.
602   ///
603   /// \param[in] filter_sp
604   ///    Shared pointer to the search filter that restricts the search domain of
605   ///    the breakpoint.
606   ///
607   /// \param[in] resolver_sp
608   ///    Shared pointer to the resolver object that will determine breakpoint
609   ///    matches.
610   ///
611   /// \param hardware
612   ///    If true, request a hardware breakpoint to be used to implement the
613   ///    breakpoint locations.
614   ///
615   /// \param resolve_indirect_symbols
616   ///    If true, and the address of a given breakpoint location in this
617   ///    breakpoint is set on an
618   ///    indirect symbol (i.e. Symbol::IsIndirect returns true) then the actual
619   ///    breakpoint site will
620   ///    be set on the target of the indirect symbol.
621   // This is the generic constructor
622   Breakpoint(Target &target, lldb::SearchFilterSP &filter_sp,
623              lldb::BreakpointResolverSP &resolver_sp, bool hardware,
624              bool resolve_indirect_symbols = true);
625 
626   friend class BreakpointLocation; // To call the following two when determining
627                                    // whether to stop.
628 
629   void DecrementIgnoreCount();
630 
631 private:
632   // To call from CopyFromBreakpoint.
633   Breakpoint(Target &new_target, const Breakpoint &bp_to_copy_from);
634 
635   // For Breakpoint only
636   bool m_being_created;
637   bool
638       m_hardware; // If this breakpoint is required to use a hardware breakpoint
639   Target &m_target; // The target that holds this breakpoint.
640   std::unordered_set<std::string> m_name_list; // If not empty, this is the name
641                                                // of this breakpoint (many
642                                                // breakpoints can share the same
643                                                // name.)
644   lldb::SearchFilterSP
645       m_filter_sp; // The filter that constrains the breakpoint's domain.
646   lldb::BreakpointResolverSP
647       m_resolver_sp; // The resolver that defines this breakpoint.
648   lldb::BreakpointPreconditionSP m_precondition_sp; // The precondition is a
649                                                     // breakpoint-level hit
650                                                     // filter that can be used
651   // to skip certain breakpoint hits.  For instance, exception breakpoints use
652   // this to limit the stop to certain exception classes, while leaving the
653   // condition & callback free for user specification.
654   BreakpointOptions m_options; // Settable breakpoint options
655   BreakpointLocationList
656       m_locations; // The list of locations currently found for this breakpoint.
657   std::string m_kind_description;
658   bool m_resolve_indirect_symbols;
659 
660   /// Number of times this breakpoint has been hit. This is kept separately
661   /// from the locations hit counts, since locations can go away when their
662   /// backing library gets unloaded, and we would lose hit counts.
663   StoppointHitCounter m_hit_counter;
664 
665   BreakpointName::Permissions m_permissions;
666 
667   StatsDuration m_resolve_time;
668 
669   void SendBreakpointChangedEvent(lldb::BreakpointEventType eventKind);
670 
671   void SendBreakpointChangedEvent(BreakpointEventData *data);
672 
673   Breakpoint(const Breakpoint &) = delete;
674   const Breakpoint &operator=(const Breakpoint &) = delete;
675 };
676 
677 } // namespace lldb_private
678 
679 #endif // LLDB_BREAKPOINT_BREAKPOINT_H
680