1 //===-- SBFrame.h -----------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBFrame_h_
11 #define LLDB_SBFrame_h_
13 #include "lldb/API/SBDefines.h"
14 #include "lldb/API/SBValueList.h"
23 SBFrame (const lldb::SBFrame &rhs);
26 operator =(const lldb::SBFrame &rhs);
31 IsEqual (const lldb::SBFrame &that) const;
43 SetPC (lldb::addr_t new_pc);
52 GetPCAddress () const;
55 GetSymbolContext (uint32_t resolve_scope) const;
61 GetCompileUnit () const;
69 /// Gets the deepest block that contains the frame PC.
71 /// See also GetFrameBlock().
75 /// Get the appropriate function name for this frame. Inlined functions in
76 /// LLDB are represented by Blocks that have inlined function information, so
77 /// just looking at the SBFunction or SBSymbol for a frame isn't enough.
78 /// This function will return the appriopriate function, symbol or inlined
79 /// function name for the frame.
81 /// This function returns:
82 /// - the name of the inlined function (if there is one)
83 /// - the name of the concrete function (if there is one)
84 /// - the name of the symbol (if there is one)
87 /// See also IsInlined().
91 /// Return true if this frame represents an inlined function.
93 /// See also GetFunctionName().
97 /// The version that doesn't supply a 'use_dynamic' value will use the
100 EvaluateExpression (const char *expr);
103 EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
106 EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
109 EvaluateExpression (const char *expr, const SBExpressionOptions &options);
111 /// Gets the lexical block that defines the stack frame. Another way to think
112 /// of this is it will return the block that contains all of the variables
113 /// for a stack frame. Inlined functions are represented as SBBlock objects
114 /// that have inlined function information: the name of the inlined function,
115 /// where it was called from. The block that is returned will be the first
116 /// block at or above the block for the PC (SBFrame::GetBlock()) that defines
117 /// the scope of the frame. When a function contains no inlined functions,
118 /// this will be the top most lexical block that defines the function.
119 /// When a function has inlined functions and the PC is currently
120 /// in one of those inlined functions, this method will return the inlined
121 /// block that defines this frame. If the PC isn't currently in an inlined
122 /// function, the lexical block that defines the function is returned.
124 GetFrameBlock () const;
127 GetLineEntry () const;
133 Disassemble () const;
139 operator == (const lldb::SBFrame &rhs) const;
142 operator != (const lldb::SBFrame &rhs) const;
144 /// The version that doesn't supply a 'use_dynamic' value will use the
145 /// target's default.
147 GetVariables (bool arguments,
153 GetVariables (bool arguments,
157 lldb::DynamicValueType use_dynamic);
163 FindRegister (const char *name);
165 /// The version that doesn't supply a 'use_dynamic' value will use the
166 /// target's default.
168 FindVariable (const char *var_name);
171 FindVariable (const char *var_name, lldb::DynamicValueType use_dynamic);
173 // Find a value for a variable expression path like "rect.origin.x" or
174 // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_
175 // and expression result and is not a constant object like
176 // SBFrame::EvaluateExpression(...) returns, but a child object of
177 // the variable value.
179 GetValueForVariablePath (const char *var_expr_cstr,
180 DynamicValueType use_dynamic);
182 /// The version that doesn't supply a 'use_dynamic' value will use the
183 /// target's default.
185 GetValueForVariablePath (const char *var_path);
187 /// Find variables, register sets, registers, or persistent variables using
188 /// the frame as the scope.
190 /// NB. This function does not look up ivars in the function object pointer.
191 /// To do that use GetValueForVariablePath.
193 /// The version that doesn't supply a 'use_dynamic' value will use the
194 /// target's default.
196 FindValue (const char *name, ValueType value_type);
199 FindValue (const char *name, ValueType value_type, lldb::DynamicValueType use_dynamic);
201 /// Find and watch a variable using the frame as the scope.
202 /// It returns an SBValue, similar to FindValue() method, if find-and-watch
203 /// operation succeeds. Otherwise, an invalid SBValue is returned.
204 /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch.
206 WatchValue (const char *name, ValueType value_type, uint32_t watch_type);
208 /// Find and watch the location pointed to by a variable using the frame as
210 /// It returns an SBValue, similar to FindValue() method, if find-and-watch
211 /// operation succeeds. Otherwise, an invalid SBValue is returned.
212 /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch.
214 WatchLocation (const char *name, ValueType value_type, uint32_t watch_type, size_t size);
217 GetDescription (lldb::SBStream &description);
219 SBFrame (const lldb::StackFrameSP &lldb_object_sp);
223 friend class SBBlock;
224 friend class SBInstruction;
225 friend class SBThread;
226 friend class SBValue;
227 #ifndef LLDB_DISABLE_PYTHON
228 friend class lldb_private::ScriptInterpreterPython;
235 SetFrameSP (const lldb::StackFrameSP &lldb_object_sp);
237 lldb::ExecutionContextRefSP m_opaque_sp;
242 #endif // LLDB_SBFrame_h_