]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBBreakpoint.h
MFV r288408:
[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 namespace lldb {
16
17 class SBBreakpoint
18 {
19 public:
20
21     typedef bool (*BreakpointHitCallback) (void *baton, 
22                                            SBProcess &process,
23                                            SBThread &thread, 
24                                            lldb::SBBreakpointLocation &location);
25
26     SBBreakpoint ();
27
28     SBBreakpoint (const lldb::SBBreakpoint& rhs);
29
30     ~SBBreakpoint();
31
32     const lldb::SBBreakpoint &
33     operator = (const lldb::SBBreakpoint& rhs);
34     
35     // Tests to see if the opaque breakpoint object in this object matches the
36     // opaque breakpoint object in "rhs".
37     bool
38     operator == (const lldb::SBBreakpoint& rhs);
39
40     bool
41     operator != (const lldb::SBBreakpoint& rhs);
42     
43     break_id_t
44     GetID () const;
45
46     bool
47     IsValid() const;
48
49     void
50     ClearAllBreakpointSites ();
51
52     lldb::SBBreakpointLocation
53     FindLocationByAddress (lldb::addr_t vm_addr);
54
55     lldb::break_id_t
56     FindLocationIDByAddress (lldb::addr_t vm_addr);
57
58     lldb::SBBreakpointLocation
59     FindLocationByID (lldb::break_id_t bp_loc_id);
60
61     lldb::SBBreakpointLocation
62     GetLocationAtIndex (uint32_t index);
63
64     void
65     SetEnabled (bool enable);
66
67     bool
68     IsEnabled ();
69     
70     void
71     SetOneShot (bool one_shot);
72
73     bool
74     IsOneShot () const;
75     
76     bool
77     IsInternal ();
78
79     uint32_t
80     GetHitCount () const;
81
82     void
83     SetIgnoreCount (uint32_t count);
84
85     uint32_t
86     GetIgnoreCount () const;
87     
88     void 
89     SetCondition (const char *condition);
90     
91     const char *
92     GetCondition ();
93
94     void
95     SetThreadID (lldb::tid_t sb_thread_id);
96
97     lldb::tid_t
98     GetThreadID ();
99     
100     void
101     SetThreadIndex (uint32_t index);
102     
103     uint32_t
104     GetThreadIndex() const;
105     
106     void
107     SetThreadName (const char *thread_name);
108     
109     const char *
110     GetThreadName () const;
111     
112     void 
113     SetQueueName (const char *queue_name);
114     
115     const char *
116     GetQueueName () const;
117
118     void
119     SetCallback (BreakpointHitCallback callback, void *baton);
120     
121     void
122     SetScriptCallbackFunction (const char *callback_function_name);
123     
124     SBError
125     SetScriptCallbackBody (const char *script_body_text);
126
127     bool
128     AddName (const char *new_name);
129
130     void
131     RemoveName (const char *name_to_remove);
132
133     bool
134     MatchesName (const char *name);
135
136     void
137     GetNames (SBStringList &names);
138     
139     size_t
140     GetNumResolvedLocations() const;
141
142     size_t
143     GetNumLocations() const;
144
145     bool
146     GetDescription (lldb::SBStream &description);
147
148     static bool
149     EventIsBreakpointEvent (const lldb::SBEvent &event);
150     
151     static lldb::BreakpointEventType
152     GetBreakpointEventTypeFromEvent (const lldb::SBEvent& event);
153
154     static lldb::SBBreakpoint
155     GetBreakpointFromEvent (const lldb::SBEvent& event);
156     
157     static lldb::SBBreakpointLocation
158     GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx);
159     
160     static uint32_t
161     GetNumBreakpointLocationsFromEvent (const lldb::SBEvent &event_sp);
162
163
164 private:
165     friend class SBBreakpointLocation;
166     friend class SBTarget;
167
168     SBBreakpoint (const lldb::BreakpointSP &bp_sp);
169
170     lldb_private::Breakpoint *
171     operator->() const;
172
173     lldb_private::Breakpoint *
174     get() const;
175
176     lldb::BreakpointSP &
177     operator *();
178
179     const lldb::BreakpointSP &
180     operator *() const;
181
182     static bool
183     PrivateBreakpointHitCallback (void *baton, 
184                                   lldb_private::StoppointCallbackContext *context, 
185                                   lldb::user_id_t break_id, 
186                                   lldb::user_id_t break_loc_id);
187     
188     lldb::BreakpointSP m_opaque_sp;
189 };
190
191 } // namespace lldb
192
193 #endif  // LLDB_SBBreakpoint_h_