SBFrame.h revision 59c5d5dbe1b565bca389c9547377a2dd17b9e956
1//===-- SBFrame.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_SBFrame_h_
11#define LLDB_SBFrame_h_
12
13#include "lldb/API/SBDefines.h"
14#include "lldb/API/SBValueList.h"
15
16namespace lldb {
17
18class SBValue;
19
20class SBFrame
21{
22public:
23    SBFrame ();
24
25   ~SBFrame();
26
27    bool
28    IsValid() const;
29
30    uint32_t
31    GetFrameID () const;
32
33    lldb::addr_t
34    GetPC () const;
35
36    bool
37    SetPC (lldb::addr_t new_pc);
38
39    lldb::addr_t
40    GetSP () const;
41
42    lldb::addr_t
43    GetFP () const;
44
45    lldb::SBAddress
46    GetPCAddress () const;
47
48    lldb::SBSymbolContext
49    GetSymbolContext (uint32_t resolve_scope) const;
50
51    lldb::SBModule
52    GetModule () const;
53
54    lldb::SBCompileUnit
55    GetCompileUnit () const;
56
57    lldb::SBFunction
58    GetFunction () const;
59
60    // Gets the deepest block that contains the frame PC
61    lldb::SBBlock
62    GetBlock () const;
63
64    // Gets the lexical block that defines the stack frame. Another way to think
65    // of this is it will return the block that contains all of the variables
66    // for a stack frame. Inlined functions are represented as SBBlock objects
67    // that have inlined function information: the name of the inlined function,
68    // where it was called from. The block that is returned will be the first
69    // block at or above the block for the PC (SBFrame::GetBlock()) that defines
70    // the scope of the frame. When a function contains no inlined functions,
71    // this will be the top most lexical block that defines the function.
72    // When a function has inlined functions and the PC is currently
73    // in one of those inlined functions, this method will return the inlined
74    // block that defines this frame. If the PC isn't currently in an inlined
75    // function, the lexical block that defines the function is returned.
76    lldb::SBBlock
77    GetFrameBlock () const;
78
79    lldb::SBLineEntry
80    GetLineEntry () const;
81
82    lldb::SBThread
83    GetThread () const;
84
85    const char *
86    Disassemble () const;
87
88    void
89    Clear();
90
91#ifndef SWIG
92    bool
93    operator == (const lldb::SBFrame &rhs) const;
94
95    bool
96    operator != (const lldb::SBFrame &rhs) const;
97
98#endif
99
100    lldb::SBValueList
101    GetVariables (bool arguments,
102                  bool locals,
103                  bool statics,
104                  bool in_scope_only);
105
106    lldb::SBValueList
107    GetRegisters ();
108
109    lldb::SBValue
110    LookupVar (const char *var_name);
111
112    lldb::SBValue
113    LookupVarInScope (const char *var_name, const char *scope);
114
115    bool
116    GetDescription (lldb::SBStream &description);
117
118protected:
119    friend class SBValue;
120
121    lldb_private::StackFrame *
122    GetLLDBObjectPtr ();
123
124private:
125    friend class SBThread;
126    friend class lldb_private::ScriptInterpreterPython;
127
128#ifndef SWIG
129
130    lldb_private::StackFrame *
131    operator->() const;
132
133    // Mimic shared pointer...
134    lldb_private::StackFrame *
135    get() const;
136
137#endif
138
139
140    SBFrame (const lldb::StackFrameSP &lldb_object_sp);
141
142    void
143    SetFrame (const lldb::StackFrameSP &lldb_object_sp);
144
145    lldb::StackFrameSP m_opaque_sp;
146};
147
148} // namespace lldb
149
150#endif  // LLDB_SBFrame_h_
151