LLDB API Documentation

SBBreakpoint.h
Go to the documentation of this file.
1 //===-- SBBreakpoint.h ------------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLDB_SBBreakpoint_h_
11 #define LLDB_SBBreakpoint_h_
12 
13 #include "lldb/API/SBDefines.h"
14 
15 namespace lldb {
16 
17 class LLDB_API SBBreakpoint {
18 public:
19  typedef bool (*BreakpointHitCallback)(void *baton, SBProcess &process,
20  SBThread &thread,
21  lldb::SBBreakpointLocation &location);
22 
23  SBBreakpoint();
24 
25  SBBreakpoint(const lldb::SBBreakpoint &rhs);
26 
27  ~SBBreakpoint();
28 
29  const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
30 
31  // Tests to see if the opaque breakpoint object in this object matches the
32  // opaque breakpoint object in "rhs".
33  bool operator==(const lldb::SBBreakpoint &rhs);
34 
35  bool operator!=(const lldb::SBBreakpoint &rhs);
36 
37  break_id_t GetID() const;
38 
39  bool IsValid() const;
40 
41  void ClearAllBreakpointSites();
42 
43  lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
44 
45  lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
46 
47  lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
48 
49  lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
50 
51  void SetEnabled(bool enable);
52 
53  bool IsEnabled();
54 
55  void SetOneShot(bool one_shot);
56 
57  bool IsOneShot() const;
58 
59  bool IsInternal();
60 
61  uint32_t GetHitCount() const;
62 
63  void SetIgnoreCount(uint32_t count);
64 
65  uint32_t GetIgnoreCount() const;
66 
67  void SetCondition(const char *condition);
68 
69  const char *GetCondition();
70 
71  void SetThreadID(lldb::tid_t sb_thread_id);
72 
73  lldb::tid_t GetThreadID();
74 
75  void SetThreadIndex(uint32_t index);
76 
77  uint32_t GetThreadIndex() const;
78 
79  void SetThreadName(const char *thread_name);
80 
81  const char *GetThreadName() const;
82 
83  void SetQueueName(const char *queue_name);
84 
85  const char *GetQueueName() const;
86 
87  void SetCallback(BreakpointHitCallback callback, void *baton);
88 
89  void SetScriptCallbackFunction(const char *callback_function_name);
90 
91  void SetCommandLineCommands(SBStringList &commands);
92 
93  bool GetCommandLineCommands(SBStringList &commands);
94 
95  SBError SetScriptCallbackBody(const char *script_body_text);
96 
97  bool AddName(const char *new_name);
98 
99  void RemoveName(const char *name_to_remove);
100 
101  bool MatchesName(const char *name);
102 
103  void GetNames(SBStringList &names);
104 
105  size_t GetNumResolvedLocations() const;
106 
107  size_t GetNumLocations() const;
108 
109  bool GetDescription(lldb::SBStream &description);
110 
111  bool GetDescription(lldb::SBStream &description, bool include_locations);
112 
113  static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
114 
115  static lldb::BreakpointEventType
116  GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
117 
118  static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
119 
121  GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
122  uint32_t loc_idx);
123 
124  static uint32_t
125  GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
126 
127 private:
128  friend class SBBreakpointList;
129  friend class SBBreakpointLocation;
130  friend class SBTarget;
131 
132  SBBreakpoint(const lldb::BreakpointSP &bp_sp);
133 
134  lldb_private::Breakpoint *operator->() const;
135 
136  lldb_private::Breakpoint *get() const;
137 
138  lldb::BreakpointSP &operator*();
139 
140  const lldb::BreakpointSP &operator*() const;
141 
142  static bool PrivateBreakpointHitCallback(
143  void *baton, lldb_private::StoppointCallbackContext *context,
144  lldb::user_id_t break_id, lldb::user_id_t break_loc_id);
145 
146  lldb::BreakpointSP m_opaque_sp;
147 };
148 
149 class SBBreakpointListImpl;
150 
151 class LLDB_API SBBreakpointList {
152 public:
153  SBBreakpointList(SBTarget &target);
154 
155  ~SBBreakpointList();
156 
157  size_t GetSize() const;
158 
159  SBBreakpoint GetBreakpointAtIndex(size_t idx);
160 
161  SBBreakpoint FindBreakpointByID(lldb::break_id_t);
162 
163  void Append(const SBBreakpoint &sb_file);
164 
165  bool AppendIfUnique(const SBBreakpoint &sb_file);
166 
167  void AppendByID(lldb::break_id_t id);
168 
169  void Clear();
170 
171 protected:
172  friend class SBTarget;
173 
174  void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
175 
176 private:
177  std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
178 };
179 
180 } // namespace lldb
181 
182 #endif // LLDB_SBBreakpoint_h_
class LLDB_API SBBreakpoint
Definition: SBDefines.h:33