]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBBreakpoint.h
MFV r344063:
[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
22   SBBreakpoint();
23
24   SBBreakpoint(const lldb::SBBreakpoint &rhs);
25
26   ~SBBreakpoint();
27
28   const lldb::SBBreakpoint &operator=(const lldb::SBBreakpoint &rhs);
29
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);
33
34   bool operator!=(const lldb::SBBreakpoint &rhs);
35
36   break_id_t GetID() const;
37
38   bool IsValid() const;
39
40   void ClearAllBreakpointSites();
41
42   lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
43
44   lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
45
46   lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id);
47
48   lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index);
49
50   void SetEnabled(bool enable);
51
52   bool IsEnabled();
53
54   void SetOneShot(bool one_shot);
55
56   bool IsOneShot() const;
57
58   bool IsInternal();
59
60   uint32_t GetHitCount() const;
61
62   void SetIgnoreCount(uint32_t count);
63
64   uint32_t GetIgnoreCount() const;
65
66   void SetCondition(const char *condition);
67
68   const char *GetCondition();
69
70   void SetAutoContinue(bool auto_continue);
71
72   bool GetAutoContinue();
73
74   void SetThreadID(lldb::tid_t sb_thread_id);
75
76   lldb::tid_t GetThreadID();
77
78   void SetThreadIndex(uint32_t index);
79
80   uint32_t GetThreadIndex() const;
81
82   void SetThreadName(const char *thread_name);
83
84   const char *GetThreadName() const;
85
86   void SetQueueName(const char *queue_name);
87
88   const char *GetQueueName() const;
89
90   void SetCallback(SBBreakpointHitCallback callback, void *baton);
91
92   void SetScriptCallbackFunction(const char *callback_function_name);
93
94   void SetCommandLineCommands(SBStringList &commands);
95
96   bool GetCommandLineCommands(SBStringList &commands);
97
98   SBError SetScriptCallbackBody(const char *script_body_text);
99
100   bool AddName(const char *new_name);
101
102   void RemoveName(const char *name_to_remove);
103
104   bool MatchesName(const char *name);
105
106   void GetNames(SBStringList &names);
107
108   size_t GetNumResolvedLocations() const;
109
110   size_t GetNumLocations() const;
111
112   bool GetDescription(lldb::SBStream &description);
113
114   bool GetDescription(lldb::SBStream &description, bool include_locations);
115
116   static bool EventIsBreakpointEvent(const lldb::SBEvent &event);
117
118   static lldb::BreakpointEventType
119   GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event);
120
121   static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event);
122
123   static lldb::SBBreakpointLocation
124   GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
125                                         uint32_t loc_idx);
126
127   static uint32_t
128   GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp);
129
130 private:
131   friend class SBBreakpointList;
132   friend class SBBreakpointLocation;
133   friend class SBBreakpointName;
134   friend class SBTarget;
135
136   SBBreakpoint(const lldb::BreakpointSP &bp_sp);
137
138   lldb::BreakpointSP GetSP() const;
139
140   lldb::BreakpointWP m_opaque_wp;
141 };
142
143 class LLDB_API SBBreakpointList {
144 public:
145   SBBreakpointList(SBTarget &target);
146
147   ~SBBreakpointList();
148
149   size_t GetSize() const;
150
151   SBBreakpoint GetBreakpointAtIndex(size_t idx);
152
153   SBBreakpoint FindBreakpointByID(lldb::break_id_t);
154
155   void Append(const SBBreakpoint &sb_bkpt);
156
157   bool AppendIfUnique(const SBBreakpoint &sb_bkpt);
158
159   void AppendByID(lldb::break_id_t id);
160
161   void Clear();
162
163 protected:
164   friend class SBTarget;
165
166   void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list);
167
168 private:
169   std::shared_ptr<SBBreakpointListImpl> m_opaque_sp;
170 };
171
172 } // namespace lldb
173
174 #endif // LLDB_SBBreakpoint_h_