summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/API/SBBreakpoint.h
blob: 3b9642df4eeb374d92e79dfdd7cedff10a51abfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//===-- SBBreakpoint.h ------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SBBreakpoint_h_
#define LLDB_SBBreakpoint_h_

#include "lldb/API/SBDefines.h"
#include <stdio.h>

namespace lldb {

class SBBreakpoint
{
public:

    typedef bool (*BreakpointHitCallback) (void *baton, 
                                           SBProcess &process,
                                           SBThread &thread, 
                                           lldb::SBBreakpointLocation &location);

    SBBreakpoint ();

    SBBreakpoint (const lldb::SBBreakpoint& rhs);

    ~SBBreakpoint();

#ifndef SWIG
    const SBBreakpoint &
    operator = (const SBBreakpoint& rhs);
#endif

    break_id_t
    GetID () const;

    bool
    IsValid() const;

    void
    Dump (FILE *f);

    void
    ClearAllBreakpointSites ();

    lldb::SBBreakpointLocation
    FindLocationByAddress (lldb::addr_t vm_addr);

    lldb::break_id_t
    FindLocationIDByAddress (lldb::addr_t vm_addr);

    lldb::SBBreakpointLocation
    FindLocationByID (lldb::break_id_t bp_loc_id);

    lldb::SBBreakpointLocation
    GetLocationAtIndex (uint32_t index);

    void
    ListLocations (FILE *, const char *description_level = "full");

    void
    SetEnabled (bool enable);

    bool
    IsEnabled ();

    void
    SetIgnoreCount (int32_t count);

    int32_t
    GetIgnoreCount () const;

    void
    SetThreadID (lldb::tid_t sb_thread_id);

    lldb::tid_t
    GetThreadID ();
    
    void
    SetThreadIndex (uint32_t index);
    
    uint32_t
    GetThreadIndex() const;
    
    void
    SetThreadName (const char *thread_name);
    
    const char *
    GetThreadName () const;
    
    void 
    SetQueueName (const char *queue_name);
    
    const char *
    GetQueueName () const;

    void
    SetCallback (BreakpointHitCallback callback, void *baton);

    size_t
    GetNumResolvedLocations() const;

    size_t
    GetNumLocations() const;

    void
    GetDescription (FILE *, const char *description_level, bool describe_locations = false);



private:
    friend class SBBreakpointLocation;
    friend class SBTarget;

    SBBreakpoint (const lldb::BreakpointSP &bp_sp);

#ifndef SWIG

    lldb_private::Breakpoint *
    operator->() const;

    lldb_private::Breakpoint *
    get() const;

    lldb::BreakpointSP &
    operator *();

    const lldb::BreakpointSP &
    operator *() const;

#endif

    static bool
    PrivateBreakpointHitCallback (void *baton, 
                                  lldb_private::StoppointCallbackContext *context, 
                                  lldb::user_id_t break_id, 
                                  lldb::user_id_t break_loc_id);
    
    lldb::BreakpointSP m_break_sp;
};

} // namespace lldb

#endif  // LLDB_SBBreakpoint_h_
OpenPOWER on IntegriCloud