LLDB API Documentation

- Main Page
- Namespaces
- Classes
- Files

- File List

SBFrame.h
Go to the documentation of this file.
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
16 namespace lldb {
17
18 class LLDB_API SBFrame {
19 public:
20 SBFrame();
21
22 SBFrame(const lldb::SBFrame &rhs);
23
24 const lldb::SBFrame &operator=(const lldb::SBFrame &rhs);
25
26 ~SBFrame();
27
28 bool IsEqual(const lldb::SBFrame &that) const;
29
30 bool IsValid() const;
31
32 uint32_t GetFrameID() const;
33
34 lldb::addr_t GetCFA() const;
35
36 lldb::addr_t GetPC() const;
37
38 bool SetPC(lldb::addr_t new_pc);
39
40 lldb::addr_t GetSP() const;
41
42 lldb::addr_t GetFP() const;
43
44 lldb::SBAddress GetPCAddress() const;
45
46 lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope) const;
47
48 lldb::SBModule GetModule() const;
49
50 lldb::SBCompileUnit GetCompileUnit() const;
51
52 lldb::SBFunction GetFunction() const;
53
54 lldb::SBSymbol GetSymbol() const;
55
56 /// Gets the deepest block that contains the frame PC.
57 ///
58 /// See also GetFrameBlock().
59 lldb::SBBlock GetBlock() const;
60
61 /// Get the appropriate function name for this frame. Inlined functions in
62 /// LLDB are represented by Blocks that have inlined function information, so
63 /// just looking at the SBFunction or SBSymbol for a frame isn't enough.
64 /// This function will return the appropriate function, symbol or inlined
65 /// function name for the frame.
66 ///
67 /// This function returns:
68 /// - the name of the inlined function (if there is one)
69 /// - the name of the concrete function (if there is one)
70 /// - the name of the symbol (if there is one)
71 /// - NULL
72 ///
73 /// See also IsInlined().
74 const char *GetFunctionName();
75
76 // Get an appropriate function name for this frame that is suitable for
77 // display to a user
78 const char *GetDisplayFunctionName();
79
80 const char *GetFunctionName() const;
81
82 /// Return true if this frame represents an inlined function.
83 ///
84 /// See also GetFunctionName().
85 bool IsInlined();
86
87 bool IsInlined() const;
88
89 /// The version that doesn't supply a 'use_dynamic' value will use the
90 /// target's default.
91 lldb::SBValue EvaluateExpression(const char *expr);
92
93 lldb::SBValue EvaluateExpression(const char *expr,
94 lldb::DynamicValueType use_dynamic);
95
96 lldb::SBValue EvaluateExpression(const char *expr,
97 lldb::DynamicValueType use_dynamic,
98 bool unwind_on_error);
99
100 lldb::SBValue EvaluateExpression(const char *expr,
101 const SBExpressionOptions &options);
102
103 /// Gets the lexical block that defines the stack frame. Another way to think
104 /// of this is it will return the block that contains all of the variables
105 /// for a stack frame. Inlined functions are represented as SBBlock objects
106 /// that have inlined function information: the name of the inlined function,
107 /// where it was called from. The block that is returned will be the first
108 /// block at or above the block for the PC (SBFrame::GetBlock()) that defines
109 /// the scope of the frame. When a function contains no inlined functions,
110 /// this will be the top most lexical block that defines the function.
111 /// When a function has inlined functions and the PC is currently
112 /// in one of those inlined functions, this method will return the inlined
113 /// block that defines this frame. If the PC isn't currently in an inlined
114 /// function, the lexical block that defines the function is returned.
115 lldb::SBBlock GetFrameBlock() const;
116
117 lldb::SBLineEntry GetLineEntry() const;
118
119 lldb::SBThread GetThread() const;
120
121 const char *Disassemble() const;
122
123 void Clear();
124
125 bool operator==(const lldb::SBFrame &rhs) const;
126
127 bool operator!=(const lldb::SBFrame &rhs) const;
128
129 /// The version that doesn't supply a 'use_dynamic' value will use the
130 /// target's default.
131 lldb::SBValueList GetVariables(bool arguments, bool locals, bool statics,
132 bool in_scope_only);
133
134 lldb::SBValueList GetVariables(bool arguments, bool locals, bool statics,
135 bool in_scope_only,
136 lldb::DynamicValueType use_dynamic);
137
138 lldb::SBValueList GetVariables(const lldb::SBVariablesOptions &options);
139
140 lldb::SBValueList GetRegisters();
141
142 lldb::SBValue FindRegister(const char *name);
143
144 /// The version that doesn't supply a 'use_dynamic' value will use the
145 /// target's default.
146 lldb::SBValue FindVariable(const char *var_name);
147
148 lldb::SBValue FindVariable(const char *var_name,
149 lldb::DynamicValueType use_dynamic);
150
151 // Find a value for a variable expression path like "rect.origin.x" or
152 // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_
153 // and expression result and is not a constant object like
154 // SBFrame::EvaluateExpression(...) returns, but a child object of
155 // the variable value.
156 lldb::SBValue GetValueForVariablePath(const char *var_expr_cstr,
157 DynamicValueType use_dynamic);
158
159 /// The version that doesn't supply a 'use_dynamic' value will use the
160 /// target's default.
161 lldb::SBValue GetValueForVariablePath(const char *var_path);
162
163 /// Find variables, register sets, registers, or persistent variables using
164 /// the frame as the scope.
165 ///
166 /// NB. This function does not look up ivars in the function object pointer.
167 /// To do that use GetValueForVariablePath.
168 ///
169 /// The version that doesn't supply a 'use_dynamic' value will use the
170 /// target's default.
171 lldb::SBValue FindValue(const char *name, ValueType value_type);
172
173 lldb::SBValue FindValue(const char *name, ValueType value_type,
174 lldb::DynamicValueType use_dynamic);
175
176 bool GetDescription(lldb::SBStream &description);
177
178 SBFrame(const lldb::StackFrameSP &lldb_object_sp);
179
180 protected:
181 friend class SBBlock;
182 friend class SBExecutionContext;
183 friend class SBInstruction;
184 friend class SBThread;
185 friend class SBValue;
186
187 lldb::StackFrameSP GetFrameSP() const;
188
189 void SetFrameSP(const lldb::StackFrameSP &lldb_object_sp);
190
191 lldb::ExecutionContextRefSP m_opaque_sp;
192 };
193
194 } // namespace lldb
195
196 #endif // LLDB_SBFrame_h_
lldb::SBThread
Definition: SBThread.h:21
lldb::SBSymbolContext
Definition: SBSymbolContext.h:23
lldb::SBFrame
class LLDB_API SBFrame
Definition: SBDefines.h:53
lldb::SBFrame
Definition: SBFrame.h:18
SBDefines.h
lldb::SBSymbol
Definition: SBSymbol.h:20
SBValueList.h
lldb::SBFrame::m_opaque_sp
lldb::ExecutionContextRefSP m_opaque_sp
Definition: SBFrame.h:191
lldb::SBValue
Definition: SBValue.h:22
lldb::SBExpressionOptions
Definition: SBExpressionOptions.h:19
lldb::SBBlock
Definition: SBBlock.h:20
lldb::SBInstruction
Definition: SBInstruction.h:26
lldb::SBLineEntry
Definition: SBLineEntry.h:19
lldb::SBCompileUnit
Definition: SBCompileUnit.h:18
lldb::SBAddress
Definition: SBAddress.h:18
lldb::SBModule
Definition: SBModule.h:21
lldb::SBVariablesOptions
Definition: SBVariablesOptions.h:20
lldb::SBFunction
Definition: SBFunction.h:19
lldb::SBValueList
Definition: SBValueList.h:19
lldb::SBExecutionContext
Definition: SBExecutionContext.h:21
lldb::SBStream
Definition: SBStream.h:19