]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBBreakpoint.h
Update mandoc to 1.14.2
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / API / SBBreakpoint.h
1 //===-- SBBreakpoint.h ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_SBBreakpoint_h_
11 #define LLDB_SBBreakpoint_h_
12
13 #include "lldb/API/SBDefines.h"
14
15 class SBBreakpointListImpl;
16
17 namespace lldb {
18
19 class LLDB_API SBBreakpoint {
20 public:
21   typedef bool (*BreakpointHitCallback)(void *baton, SBProcess &process,
22                                         SBThread &thread,
23                                         lldb::SBBreakpointLocation &location);
24
25   SBBreakpoint();
26
27   SBBreakpoint(const lldb::SBBreakpoint &rhs);
28
29   ~SBBreakpoint();
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   bool IsValid() const;
42
43   void ClearAllBreakpointSites();
44
45   lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
46
47   lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
48
49   lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
50
51   lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
52
53   void SetEnabled(bool enable);
54
55   bool IsEnabled();
56
57   void SetOneShot(bool one_shot);
58
59   bool IsOneShot() const;
60
61   bool IsInternal();
62
63   uint32_t GetHitCount() const;
64
65   void SetIgnoreCount(uint32_t count);
66
67   uint32_t GetIgnoreCount() const;
68
69   void SetCondition(const char *condition);
70
71   const char *GetCondition();
72
73   void SetThreadID(lldb::tid_t sb_thread_id);
74
75   lldb::tid_t GetThreadID();
76
77   void SetThreadIndex(uint32_t index);
78
79   uint32_t GetThreadIndex() const;
80
81   void SetThreadName(const char *thread_name);
82
83   const char *GetThreadName() const;
84
85   void SetQueueName(const char *queue_name);
86
87   const char *GetQueueName() const;
88
89   void SetCallback(BreakpointHitCallback callback, void *baton);
90
91   void SetScriptCallbackFunction(const char *callback_function_name);
92
93   void SetCommandLineCommands(SBStringList &commands);
94
95   bool GetCommandLineCommands(SBStringList &commands);
96
97   SBError SetScriptCallbackBody(const char *script_body_text);
98
99   bool AddName(const char *new_name);
100
101   void RemoveName(const char *name_to_remove);
102
103   bool MatchesName(const char *name);
104
105   void GetNames(SBStringList &names);
106
107   size_t GetNumResolvedLocations() const;
108
109   size_t GetNumLocations() const;
110
111   bool GetDescription(lldb::SBStream &description);
112
113   bool GetDescription(lldb::SBStream &description, bool include_locations);
114
115   static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
116
117   static lldb::BreakpointEventType
118   GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
119
120   static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
121
122   static lldb::SBBreakpointLocation
123   GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
124                                         uint32_t loc_idx);
125
126   static uint32_t
127   GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
128
129 private:
130   friend class SBBreakpointList;
131   friend class SBBreakpointLocation;
132   friend class SBTarget;
133
134   SBBreakpoint(const lldb::BreakpointSP &bp_sp);
135
136   static bool PrivateBreakpointHitCallback(
137       void *baton, lldb_private::StoppointCallbackContext *context,
138       lldb::user_id_t break_id, lldb::user_id_t break_loc_id);
139
140   lldb::BreakpointSP GetSP() const;
141
142   lldb::BreakpointWP m_opaque_wp;
143 };
144
145 class LLDB_API SBBreakpointList {
146 public:
147   SBBreakpointList(SBTarget &target);
148
149   ~SBBreakpointList();
150
151   size_t GetSize() const;
152
153   SBBreakpoint GetBreakpointAtIndex(size_t idx);
154
155   SBBreakpoint FindBreakpointByID(lldb::break_id_t);
156
157   void Append(const SBBreakpoint &sb_bkpt);
158
159   bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
160
161   void AppendByID(lldb::break_id_t id);
162
163   void Clear();
164
165 protected:
166   friend class SBTarget;
167
168   void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
169
170 private:
171   std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
172 };
173
174 } // namespace lldb
175
176 #endif // LLDB_SBBreakpoint_h_