aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/API/SBBlock.h
blob: a18eab02088b93c3ddf922dbc634e3f6121badf5 (plain) (blame)
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
//===-- SBBlock.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_SBBlock_h_
#define LLDB_SBBlock_h_

#include "lldb/API/SBDefines.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBValueList.h"

namespace lldb {

class LLDB_API SBBlock
{
public:

    SBBlock ();

    SBBlock (const lldb::SBBlock &rhs);

    ~SBBlock ();

    const lldb::SBBlock &
    operator = (const lldb::SBBlock &rhs);

    bool
    IsInlined () const;

    bool
    IsValid () const;

    const char *
    GetInlinedName () const;

    lldb::SBFileSpec
    GetInlinedCallSiteFile () const;

    uint32_t 
    GetInlinedCallSiteLine () const;

    uint32_t
    GetInlinedCallSiteColumn () const;

    lldb::SBBlock
    GetParent ();
    
    lldb::SBBlock
    GetSibling ();
    
    lldb::SBBlock
    GetFirstChild ();

    uint32_t
    GetNumRanges ();

    lldb::SBAddress
    GetRangeStartAddress (uint32_t idx);

    lldb::SBAddress
    GetRangeEndAddress (uint32_t idx);

    uint32_t
    GetRangeIndexForBlockAddress (lldb::SBAddress block_addr);

    lldb::SBValueList
    GetVariables (lldb::SBFrame& frame,
                  bool arguments,
                  bool locals,
                  bool statics,
                  lldb::DynamicValueType use_dynamic);
    
    lldb::SBValueList
    GetVariables (lldb::SBTarget& target,
                  bool arguments,
                  bool locals,
                  bool statics);
    //------------------------------------------------------------------
    /// Get the inlined block that contains this block.
    ///
    /// @return
    ///     If this block is inlined, it will return this block, else 
    ///     parent blocks will be searched to see if any contain this 
    ///     block and are themselves inlined. An invalid SBBlock will 
    ///     be returned if this block nor any parent blocks are inlined
    ///     function blocks.
    //------------------------------------------------------------------
    lldb::SBBlock
    GetContainingInlinedBlock ();

    bool
    GetDescription (lldb::SBStream &description);

private:
    friend class SBAddress;
    friend class SBFrame;
    friend class SBFunction;
    friend class SBSymbolContext;

    lldb_private::Block *
    GetPtr ();

    void
    SetPtr (lldb_private::Block *lldb_object_ptr);

    SBBlock (lldb_private::Block *lldb_object_ptr);

    void
    AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list);

    lldb_private::Block *m_opaque_ptr;
};


} // namespace lldb

#endif // LLDB_SBBlock_h_