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_private {
18namespace python {
19class SWIGBridge;
20}
21} // namespace lldb_private
22
23namespace lldb {
24
26public:
27
29
31
33
35
36 // Tests to see if the opaque breakpoint object in this object matches the
37 // opaque breakpoint object in "rhs".
38 bool operator==(const lldb::SBBreakpoint &rhs);
39
40 bool operator!=(const lldb::SBBreakpoint &rhs);
41
42 break_id_t GetID() const;
43
44 explicit operator bool() const;
45
46 bool IsValid() const;
47
49
51
53
55
57
59
60 void SetEnabled(bool enable);
61
62 bool IsEnabled();
63
64 void SetOneShot(bool one_shot);
65
66 bool IsOneShot() const;
67
68 bool IsInternal();
69
70 uint32_t GetHitCount() const;
71
72 void SetIgnoreCount(uint32_t count);
73
74 uint32_t GetIgnoreCount() const;
75
76 void SetCondition(const char *condition);
77
78 const char *GetCondition();
79
81
83
84 void SetAutoContinue(bool auto_continue);
85
86 bool GetAutoContinue();
87
88 void SetThreadID(lldb::tid_t sb_thread_id);
89
91
92 void SetThreadIndex(uint32_t index);
93
94 uint32_t GetThreadIndex() const;
95
96 void SetThreadName(const char *thread_name);
97
98 const char *GetThreadName() const;
99
100 void SetQueueName(const char *queue_name);
101
102 const char *GetQueueName() const;
103
104#ifndef SWIG
105 void SetCallback(SBBreakpointHitCallback callback, void *baton);
106#endif
107
108 void SetScriptCallbackFunction(const char *callback_function_name);
109
110 SBError SetScriptCallbackFunction(const char *callback_function_name,
111 SBStructuredData &extra_args);
112
113 void SetCommandLineCommands(SBStringList &commands);
114
115 bool GetCommandLineCommands(SBStringList &commands);
116
117 SBError SetScriptCallbackBody(const char *script_body_text);
118
119 LLDB_DEPRECATED_FIXME("Doesn't provide error handling",
120 "AddNameWithErrorHandling")
121 bool AddName(const char *new_name);
122
123 SBError AddNameWithErrorHandling(const char *new_name);
124
125 void RemoveName(const char *name_to_remove);
126
127 bool MatchesName(const char *name);
128
129 void GetNames(SBStringList &names);
130
131 size_t GetNumResolvedLocations() const;
132
133 size_t GetNumLocations() const;
134
135 bool GetDescription(lldb::SBStream &description);
136
137 bool GetDescription(lldb::SBStream &description, bool include_locations);
138
139 static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
140
141 static lldb::BreakpointEventType
143
144 static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
145
148 uint32_t loc_idx);
149
150 static uint32_t
152
153 bool IsHardware() const;
154
155 /// Make this breakpoint a hardware breakpoint. This will replace all existing
156 /// breakpoint locations with hardware breakpoints. Returns an error if this
157 /// fails, e.g. when there aren't enough hardware resources available.
158 lldb::SBError SetIsHardware(bool is_hardware);
159
160 /// Adds a location to the breakpoint at the address passed in.
161 /// Can only be called from a ScriptedBreakpointResolver...
162 SBError
163 AddLocation(SBAddress &address);
164 /// Add a "Facade location" to the breakpoint. This returns the Facade
165 /// Location that was added, which you can then use in
166 /// get_location_description and was_hit in your breakpoint resolver.
167 /// Can only be called from a ScriptedBreakpointResolver.
169
171
172private:
173 friend class SBBreakpointList;
175 friend class SBBreakpointName;
176 friend class SBTarget;
177
179 friend class lldb_private::python::SWIGBridge;
180
181 SBBreakpoint(const lldb::BreakpointSP &bp_sp);
182
183 lldb::BreakpointSP GetSP() const;
184
186};
187
189public:
190 SBBreakpointList(SBTarget &target);
191
193
194 size_t GetSize() const;
195
197
199
200 void Append(const SBBreakpoint &sb_bkpt);
201
202 bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
203
205
206 void Clear();
207
208protected:
209 friend class SBTarget;
210
212
213private:
214 std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
215};
216
217} // namespace lldb
218
219#endif // LLDB_API_SBBREAKPOINT_H
#define LLDB_API
Definition SBDefines.h:28
std::shared_ptr< SBBreakpointListImpl > m_opaque_sp
SBBreakpoint GetBreakpointAtIndex(size_t idx)
bool AppendIfUnique(const SBBreakpoint &sb_bkpt)
SBBreakpoint FindBreakpointByID(lldb::break_id_t)
SBBreakpointList(SBTarget &target)
void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list)
void Append(const SBBreakpoint &sb_bkpt)
void AppendByID(lldb::break_id_t id)
void SetOneShot(bool one_shot)
SBError SetScriptCallbackBody(const char *script_body_text)
SBBreakpointLocation AddFacadeLocation()
Add a "Facade location" to the breakpoint.
uint32_t GetThreadIndex() const
lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id)
LLDB_DEPRECATED_FIXME("Doesn't provide error handling", "AddNameWithErrorHandling") bool AddName(const char *new_name)
SBError AddLocation(SBAddress &address)
Adds a location to the breakpoint at the address passed in.
break_id_t GetID() const
void SetThreadID(lldb::tid_t sb_thread_id)
lldb::BreakpointWP m_opaque_wp
bool GetCommandLineCommands(SBStringList &commands)
void SetAutoContinue(bool auto_continue)
friend class lldb_private::python::SWIGBridge
void SetEnabled(bool enable)
void SetThreadName(const char *thread_name)
void SetThreadIndex(uint32_t index)
const char * GetThreadName() const
static lldb::BreakpointEventType GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event)
friend class SBTarget
uint32_t GetHitCount() const
lldb::SBError SetIsHardware(bool is_hardware)
Make this breakpoint a hardware breakpoint.
static lldb::SBBreakpointLocation GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event, uint32_t loc_idx)
lldb::tid_t GetThreadID()
void SetConditionMode(lldb::BreakpointConditionMode mode)
bool MatchesName(const char *name)
bool operator!=(const lldb::SBBreakpoint &rhs)
void SetIgnoreCount(uint32_t count)
lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr)
size_t GetNumLocations() const
SBStructuredData SerializeToStructuredData()
const lldb::SBBreakpoint & operator=(const lldb::SBBreakpoint &rhs)
lldb::SBTarget GetTarget() const
void SetScriptCallbackFunction(const char *callback_function_name)
lldb::BreakpointSP GetSP() const
static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event)
bool GetDescription(lldb::SBStream &description)
static bool EventIsBreakpointEvent(const lldb::SBEvent &event)
void SetCommandLineCommands(SBStringList &commands)
size_t GetNumResolvedLocations() const
bool IsHardware() const
bool IsOneShot() const
void SetCondition(const char *condition)
void SetQueueName(const char *queue_name)
friend class SBBreakpointList
lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr)
const char * GetCondition()
const char * GetQueueName() const
friend class SBBreakpointName
void GetNames(SBStringList &names)
friend class SBBreakpointLocation
void RemoveName(const char *name_to_remove)
uint32_t GetIgnoreCount() const
static uint32_t GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp)
SBError AddNameWithErrorHandling(const char *new_name)
friend class lldb_private::ScriptInterpreterBridge
lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index)
bool operator==(const lldb::SBBreakpoint &rhs)
void SetCallback(SBBreakpointHitCallback callback, void *baton)
lldb::BreakpointConditionMode GetConditionMode()
A class that represents a running process on the host machine.
std::weak_ptr< lldb_private::Breakpoint > BreakpointWP
BreakpointConditionMode
Modes for evaluating breakpoint conditions.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
int32_t break_id_t
Definition lldb-types.h:88
bool(* SBBreakpointHitCallback)(void *baton, lldb::SBProcess &process, lldb::SBThread &thread, lldb::SBBreakpointLocation &location)
Definition SBDefines.h:144
uint64_t addr_t
Definition lldb-types.h:80
uint64_t tid_t
Definition lldb-types.h:85