1 //===-- SBBreakpoint.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBBreakpoint_h_
11 #define LLDB_SBBreakpoint_h_
13 #include "lldb/API/SBDefines.h"
15 class SBBreakpointListImpl;
19 class LLDB_API SBBreakpoint {
24 SBBreakpoint(const lldb::SBBreakpoint &rhs);
28 const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
30 // Tests to see if the opaque breakpoint object in this object matches the
31 // opaque breakpoint object in "rhs".
32 bool operator==(const lldb::SBBreakpoint &rhs);
34 bool operator!=(const lldb::SBBreakpoint &rhs);
36 break_id_t GetID() const;
40 void ClearAllBreakpointSites();
42 lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
44 lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
46 lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
48 lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
50 void SetEnabled(bool enable);
54 void SetOneShot(bool one_shot);
56 bool IsOneShot() const;
60 uint32_t GetHitCount() const;
62 void SetIgnoreCount(uint32_t count);
64 uint32_t GetIgnoreCount() const;
66 void SetCondition(const char *condition);
68 const char *GetCondition();
70 void SetAutoContinue(bool auto_continue);
72 bool GetAutoContinue();
74 void SetThreadID(lldb::tid_t sb_thread_id);
76 lldb::tid_t GetThreadID();
78 void SetThreadIndex(uint32_t index);
80 uint32_t GetThreadIndex() const;
82 void SetThreadName(const char *thread_name);
84 const char *GetThreadName() const;
86 void SetQueueName(const char *queue_name);
88 const char *GetQueueName() const;
90 void SetCallback(SBBreakpointHitCallback callback, void *baton);
92 void SetScriptCallbackFunction(const char *callback_function_name);
94 void SetCommandLineCommands(SBStringList &commands);
96 bool GetCommandLineCommands(SBStringList &commands);
98 SBError SetScriptCallbackBody(const char *script_body_text);
100 bool AddName(const char *new_name);
102 void RemoveName(const char *name_to_remove);
104 bool MatchesName(const char *name);
106 void GetNames(SBStringList &names);
108 size_t GetNumResolvedLocations() const;
110 size_t GetNumLocations() const;
112 bool GetDescription(lldb::SBStream &description);
114 bool GetDescription(lldb::SBStream &description, bool include_locations);
116 static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
118 static lldb::BreakpointEventType
119 GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
121 static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
123 static lldb::SBBreakpointLocation
124 GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
128 GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
131 friend class SBBreakpointList;
132 friend class SBBreakpointLocation;
133 friend class SBBreakpointName;
134 friend class SBTarget;
136 SBBreakpoint(const lldb::BreakpointSP &bp_sp);
138 lldb::BreakpointSP GetSP() const;
140 lldb::BreakpointWP m_opaque_wp;
143 class LLDB_API SBBreakpointList {
145 SBBreakpointList(SBTarget &target);
149 size_t GetSize() const;
151 SBBreakpoint GetBreakpointAtIndex(size_t idx);
153 SBBreakpoint FindBreakpointByID(lldb::break_id_t);
155 void Append(const SBBreakpoint &sb_bkpt);
157 bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
159 void AppendByID(lldb::break_id_t id);
164 friend class SBTarget;
166 void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
169 std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
174 #endif // LLDB_SBBreakpoint_h_