SBBreakpoint.h revision 7dd5c51fbab8384b18f20ecc125f9a1bb3c9bcb2
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
15namespace lldb {
16
17class SBBreakpoint
18{
19public:
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    break_id_t
41    GetID () const;
42
43    bool
44    IsValid() const;
45
46    void
47    ClearAllBreakpointSites ();
48
49    lldb::SBBreakpointLocation
50    FindLocationByAddress (lldb::addr_t vm_addr);
51
52    lldb::break_id_t
53    FindLocationIDByAddress (lldb::addr_t vm_addr);
54
55    lldb::SBBreakpointLocation
56    FindLocationByID (lldb::break_id_t bp_loc_id);
57
58    lldb::SBBreakpointLocation
59    GetLocationAtIndex (uint32_t index);
60
61    void
62    SetEnabled (bool enable);
63
64    bool
65    IsEnabled ();
66
67    uint32_t
68    GetHitCount () const;
69
70    void
71    SetIgnoreCount (uint32_t count);
72
73    uint32_t
74    GetIgnoreCount () const;
75
76    void
77    SetCondition (const char *condition);
78
79    const char *
80    GetCondition ();
81
82    void
83    SetThreadID (lldb::tid_t sb_thread_id);
84
85    lldb::tid_t
86    GetThreadID ();
87
88    void
89    SetThreadIndex (uint32_t index);
90
91    uint32_t
92    GetThreadIndex() const;
93
94    void
95    SetThreadName (const char *thread_name);
96
97    const char *
98    GetThreadName () const;
99
100    void
101    SetQueueName (const char *queue_name);
102
103    const char *
104    GetQueueName () const;
105
106    void
107    SetCallback (BreakpointHitCallback callback, void *baton);
108
109    size_t
110    GetNumResolvedLocations() const;
111
112    size_t
113    GetNumLocations() const;
114
115    bool
116    GetDescription (lldb::SBStream &description);
117
118    static lldb::BreakpointEventType
119    GetBreakpointEventTypeFromEvent (const lldb::SBEvent& event);
120
121    static lldb::SBBreakpoint
122    GetBreakpointFromEvent (const lldb::SBEvent& event);
123
124    static lldb::SBBreakpointLocation
125    GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx);
126
127private:
128    friend class SBBreakpointLocation;
129    friend class SBTarget;
130
131    SBBreakpoint (const lldb::BreakpointSP &bp_sp);
132
133    lldb_private::Breakpoint *
134    operator->() const;
135
136    lldb_private::Breakpoint *
137    get() const;
138
139    lldb::BreakpointSP &
140    operator *();
141
142    const lldb::BreakpointSP &
143    operator *() const;
144
145    static bool
146    PrivateBreakpointHitCallback (void *baton,
147                                  lldb_private::StoppointCallbackContext *context,
148                                  lldb::user_id_t break_id,
149                                  lldb::user_id_t break_loc_id);
150
151    lldb::BreakpointSP m_opaque_sp;
152};
153
154} // namespace lldb
155
156#endif  // LLDB_SBBreakpoint_h_
157