File indexing completed on 2026-05-10 08:42:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_API_SBBREAKPOINT_H
0010 #define LLDB_API_SBBREAKPOINT_H
0011
0012 #include "lldb/API/SBDefines.h"
0013
0014 class SBBreakpointListImpl;
0015
0016 namespace lldb_private {
0017 class ScriptInterpreter;
0018 namespace python {
0019 class SWIGBridge;
0020 }
0021 }
0022
0023 namespace lldb {
0024
0025 class LLDB_API SBBreakpoint {
0026 public:
0027
0028 SBBreakpoint();
0029
0030 SBBreakpoint(const lldb::SBBreakpoint &rhs);
0031
0032 ~SBBreakpoint();
0033
0034 const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
0035
0036
0037
0038 bool operator==(const lldb::SBBreakpoint &rhs);
0039
0040 bool operator!=(const lldb::SBBreakpoint &rhs);
0041
0042 break_id_t GetID() const;
0043
0044 explicit operator bool() const;
0045
0046 bool IsValid() const;
0047
0048 void ClearAllBreakpointSites();
0049
0050 lldb::SBTarget GetTarget() const;
0051
0052 lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
0053
0054 lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
0055
0056 lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
0057
0058 lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
0059
0060 void SetEnabled(bool enable);
0061
0062 bool IsEnabled();
0063
0064 void SetOneShot(bool one_shot);
0065
0066 bool IsOneShot() const;
0067
0068 bool IsInternal();
0069
0070 uint32_t GetHitCount() const;
0071
0072 void SetIgnoreCount(uint32_t count);
0073
0074 uint32_t GetIgnoreCount() const;
0075
0076 void SetCondition(const char *condition);
0077
0078 const char *GetCondition();
0079
0080 void SetAutoContinue(bool auto_continue);
0081
0082 bool GetAutoContinue();
0083
0084 void SetThreadID(lldb::tid_t sb_thread_id);
0085
0086 lldb::tid_t GetThreadID();
0087
0088 void SetThreadIndex(uint32_t index);
0089
0090 uint32_t GetThreadIndex() const;
0091
0092 void SetThreadName(const char *thread_name);
0093
0094 const char *GetThreadName() const;
0095
0096 void SetQueueName(const char *queue_name);
0097
0098 const char *GetQueueName() const;
0099
0100 #ifndef SWIG
0101 void SetCallback(SBBreakpointHitCallback callback, void *baton);
0102 #endif
0103
0104 void SetScriptCallbackFunction(const char *callback_function_name);
0105
0106 SBError SetScriptCallbackFunction(const char *callback_function_name,
0107 SBStructuredData &extra_args);
0108
0109 void SetCommandLineCommands(SBStringList &commands);
0110
0111 bool GetCommandLineCommands(SBStringList &commands);
0112
0113 SBError SetScriptCallbackBody(const char *script_body_text);
0114
0115 LLDB_DEPRECATED_FIXME("Doesn't provide error handling",
0116 "AddNameWithErrorHandling")
0117 bool AddName(const char *new_name);
0118
0119 SBError AddNameWithErrorHandling(const char *new_name);
0120
0121 void RemoveName(const char *name_to_remove);
0122
0123 bool MatchesName(const char *name);
0124
0125 void GetNames(SBStringList &names);
0126
0127 size_t GetNumResolvedLocations() const;
0128
0129 size_t GetNumLocations() const;
0130
0131 bool GetDescription(lldb::SBStream &description);
0132
0133 bool GetDescription(lldb::SBStream &description, bool include_locations);
0134
0135 static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
0136
0137 static lldb::BreakpointEventType
0138 GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
0139
0140 static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
0141
0142 static lldb::SBBreakpointLocation
0143 GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
0144 uint32_t loc_idx);
0145
0146 static uint32_t
0147 GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
0148
0149 bool IsHardware() const;
0150
0151
0152 SBError
0153 AddLocation(SBAddress &address);
0154
0155 SBStructuredData SerializeToStructuredData();
0156
0157 private:
0158 friend class SBBreakpointList;
0159 friend class SBBreakpointLocation;
0160 friend class SBBreakpointName;
0161 friend class SBTarget;
0162
0163 friend class lldb_private::ScriptInterpreter;
0164 friend class lldb_private::python::SWIGBridge;
0165
0166 SBBreakpoint(const lldb::BreakpointSP &bp_sp);
0167
0168 lldb::BreakpointSP GetSP() const;
0169
0170 lldb::BreakpointWP m_opaque_wp;
0171 };
0172
0173 class LLDB_API SBBreakpointList {
0174 public:
0175 SBBreakpointList(SBTarget &target);
0176
0177 ~SBBreakpointList();
0178
0179 size_t GetSize() const;
0180
0181 SBBreakpoint GetBreakpointAtIndex(size_t idx);
0182
0183 SBBreakpoint FindBreakpointByID(lldb::break_id_t);
0184
0185 void Append(const SBBreakpoint &sb_bkpt);
0186
0187 bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
0188
0189 void AppendByID(lldb::break_id_t id);
0190
0191 void Clear();
0192
0193 protected:
0194 friend class SBTarget;
0195
0196 void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
0197
0198 private:
0199 std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
0200 };
0201
0202 }
0203
0204 #endif