PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/include/lldb/API/SBFrame.h

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