LLDB mainline
SBBreakpoint.h
Go to the documentation of this file.
1//===-- SBBreakpoint.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_API_SBBREAKPOINT_H
10#define LLDB_API_SBBREAKPOINT_H
11
12#include "lldb/API/SBDefines.h"
13
15
16namespace lldb {
17
19public:
20
22
24
25#ifndef SWIG
26 SBBreakpoint(const lldb::BreakpointSP &bp_sp);
27#endif
28
30
31 const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
32
33 // Tests to see if the opaque breakpoint object in this object matches the
34 // opaque breakpoint object in "rhs".
35 bool operator==(const lldb::SBBreakpoint &rhs);
36
37 bool operator!=(const lldb::SBBreakpoint &rhs);
38
39 break_id_t GetID() const;
40
41 explicit operator bool() const;
42
43 bool IsValid() const;
44
45 void ClearAllBreakpointSites();
46
47 lldb::SBTarget GetTarget() const;
48
49 lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
50
51 lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
52
53 lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
54
55 lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
56
57 void SetEnabled(bool enable);
58
59 bool IsEnabled();
60
61 void SetOneShot(bool one_shot);
62
63 bool IsOneShot() const;
64
65 bool IsInternal();
66
67 uint32_t GetHitCount() const;
68
69 void SetIgnoreCount(uint32_t count);
70
71 uint32_t GetIgnoreCount() const;
72
73 void SetCondition(const char *condition);
74
75 const char *GetCondition();
76
77 void SetAutoContinue(bool auto_continue);
78
79 bool GetAutoContinue();
80
81 void SetThreadID(lldb::tid_t sb_thread_id);
82
83 lldb::tid_t GetThreadID();
84
85 void SetThreadIndex(uint32_t index);
86
87 uint32_t GetThreadIndex() const;
88
89 void SetThreadName(const char *thread_name);
90
91 const char *GetThreadName() const;
92
93 void SetQueueName(const char *queue_name);
94
95 const char *GetQueueName() const;
96
97#ifndef SWIG
98 void SetCallback(SBBreakpointHitCallback callback, void *baton);
99#endif
100
101 void SetScriptCallbackFunction(const char *callback_function_name);
102
103 SBError SetScriptCallbackFunction(const char *callback_function_name,
104 SBStructuredData &extra_args);
105
106 void SetCommandLineCommands(SBStringList &commands);
107
108 bool GetCommandLineCommands(SBStringList &commands);
109
110 SBError SetScriptCallbackBody(const char *script_body_text);
111
112 bool AddName(const char *new_name);
113
114 SBError AddNameWithErrorHandling(const char *new_name);
115
116 void RemoveName(const char *name_to_remove);
117
118 bool MatchesName(const char *name);
119
120 void GetNames(SBStringList &names);
121
122 size_t GetNumResolvedLocations() const;
123
124 size_t GetNumLocations() const;
125
126 bool GetDescription(lldb::SBStream &description);
127
128 bool GetDescription(lldb::SBStream &description, bool include_locations);
129
130 static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
131
132 static lldb::BreakpointEventType
133 GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
134
135 static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
136
138 GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
139 uint32_t loc_idx);
140
141 static uint32_t
142 GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
143
144 bool IsHardware() const;
145
146 // Can only be called from a ScriptedBreakpointResolver...
147 SBError
148 AddLocation(SBAddress &address);
149
150 SBStructuredData SerializeToStructuredData();
151
152private:
153 friend class SBBreakpointList;
155 friend class SBBreakpointName;
156 friend class SBTarget;
157
158 lldb::BreakpointSP GetSP() const;
159
160 lldb::BreakpointWP m_opaque_wp;
161};
162
164public:
165 SBBreakpointList(SBTarget &target);
166
168
169 size_t GetSize() const;
170
171 SBBreakpoint GetBreakpointAtIndex(size_t idx);
172
173 SBBreakpoint FindBreakpointByID(lldb::break_id_t);
174
175 void Append(const SBBreakpoint &sb_bkpt);
176
177 bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
178
179 void AppendByID(lldb::break_id_t id);
180
181 void Clear();
182
183protected:
184 friend class SBTarget;
185
186 void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
187
188private:
189 std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
190};
191
192} // namespace lldb
193
194#endif // LLDB_API_SBBREAKPOINT_H
bool operator!=(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs)
bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs)
#define LLDB_API
Definition: SBDefines.h:26
std::shared_ptr< SBBreakpointListImpl > m_opaque_sp
Definition: SBBreakpoint.h:189
lldb::BreakpointWP m_opaque_wp
Definition: SBBreakpoint.h:160
Definition: SBAddress.h:15
int32_t break_id_t
Definition: lldb-types.h:84
uint64_t addr_t
Definition: lldb-types.h:79
uint64_t tid_t
Definition: lldb-types.h:82