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);
26 SBBreakpoint(const lldb::BreakpointSP &bp_sp);
30 const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
32 // Tests to see if the opaque breakpoint object in this object matches the
33 // opaque breakpoint object in "rhs".
34 bool operator==(const lldb::SBBreakpoint &rhs);
36 bool operator!=(const lldb::SBBreakpoint &rhs);
38 break_id_t GetID() const;
42 void ClearAllBreakpointSites();
44 lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
46 lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
48 lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
50 lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
52 void SetEnabled(bool enable);
56 void SetOneShot(bool one_shot);
58 bool IsOneShot() const;
62 uint32_t GetHitCount() const;
64 void SetIgnoreCount(uint32_t count);
66 uint32_t GetIgnoreCount() const;
68 void SetCondition(const char *condition);
70 const char *GetCondition();
72 void SetAutoContinue(bool auto_continue);
74 bool GetAutoContinue();
76 void SetThreadID(lldb::tid_t sb_thread_id);
78 lldb::tid_t GetThreadID();
80 void SetThreadIndex(uint32_t index);
82 uint32_t GetThreadIndex() const;
84 void SetThreadName(const char *thread_name);
86 const char *GetThreadName() const;
88 void SetQueueName(const char *queue_name);
90 const char *GetQueueName() const;
92 void SetCallback(SBBreakpointHitCallback callback, void *baton);
94 void SetScriptCallbackFunction(const char *callback_function_name);
96 void SetCommandLineCommands(SBStringList &commands);
98 bool GetCommandLineCommands(SBStringList &commands);
100 SBError SetScriptCallbackBody(const char *script_body_text);
102 bool AddName(const char *new_name);
104 void RemoveName(const char *name_to_remove);
106 bool MatchesName(const char *name);
108 void GetNames(SBStringList &names);
110 size_t GetNumResolvedLocations() const;
112 size_t GetNumLocations() const;
114 bool GetDescription(lldb::SBStream &description);
116 bool GetDescription(lldb::SBStream &description, bool include_locations);
118 static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
120 static lldb::BreakpointEventType
121 GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
123 static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
125 static lldb::SBBreakpointLocation
126 GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
130 GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
132 bool IsHardware() const;
134 // Can only be called from a ScriptedBreakpointResolver...
136 AddLocation(SBAddress &address);
139 friend class SBBreakpointList;
140 friend class SBBreakpointLocation;
141 friend class SBBreakpointName;
142 friend class SBTarget;
144 lldb::BreakpointSP GetSP() const;
146 lldb::BreakpointWP m_opaque_wp;
149 class LLDB_API SBBreakpointList {
151 SBBreakpointList(SBTarget &target);
155 size_t GetSize() const;
157 SBBreakpoint GetBreakpointAtIndex(size_t idx);
159 SBBreakpoint FindBreakpointByID(lldb::break_id_t);
161 void Append(const SBBreakpoint &sb_bkpt);
163 bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
165 void AppendByID(lldb::break_id_t id);
170 friend class SBTarget;
172 void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
175 std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
180 #endif // LLDB_SBBreakpoint_h_