1 //===-- SBBlock.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_SBBlock_h_ 11 #define LLDB_SBBlock_h_ 12 13 #include "lldb/API/SBDefines.h" 14 #include "lldb/API/SBFrame.h" 15 #include "lldb/API/SBTarget.h" 16 #include "lldb/API/SBValueList.h" 17 18 namespace lldb { 19 20 class LLDB_API SBBlock { 21 public: 22 SBBlock(); 23 24 SBBlock(const lldb::SBBlock &rhs); 25 26 ~SBBlock(); 27 28 const lldb::SBBlock &operator=(const lldb::SBBlock &rhs); 29 30 bool IsInlined() const; 31 32 bool IsValid() const; 33 34 const char *GetInlinedName() const; 35 36 lldb::SBFileSpec GetInlinedCallSiteFile() const; 37 38 uint32_t GetInlinedCallSiteLine() const; 39 40 uint32_t GetInlinedCallSiteColumn() const; 41 42 lldb::SBBlock GetParent(); 43 44 lldb::SBBlock GetSibling(); 45 46 lldb::SBBlock GetFirstChild(); 47 48 uint32_t GetNumRanges(); 49 50 lldb::SBAddress GetRangeStartAddress(uint32_t idx); 51 52 lldb::SBAddress GetRangeEndAddress(uint32_t idx); 53 54 uint32_t GetRangeIndexForBlockAddress(lldb::SBAddress block_addr); 55 56 lldb::SBValueList GetVariables(lldb::SBFrame &frame, bool arguments, 57 bool locals, bool statics, 58 lldb::DynamicValueType use_dynamic); 59 60 lldb::SBValueList GetVariables(lldb::SBTarget &target, bool arguments, 61 bool locals, bool statics); 62 //------------------------------------------------------------------ 63 /// Get the inlined block that contains this block. 64 /// 65 /// @return 66 /// If this block is inlined, it will return this block, else 67 /// parent blocks will be searched to see if any contain this 68 /// block and are themselves inlined. An invalid SBBlock will 69 /// be returned if this block nor any parent blocks are inlined 70 /// function blocks. 71 //------------------------------------------------------------------ 72 lldb::SBBlock GetContainingInlinedBlock(); 73 74 bool GetDescription(lldb::SBStream &description); 75 76 private: 77 friend class SBAddress; 78 friend class SBFrame; 79 friend class SBFunction; 80 friend class SBSymbolContext; 81 82 lldb_private::Block *GetPtr(); 83 84 void SetPtr(lldb_private::Block *lldb_object_ptr); 85 86 SBBlock(lldb_private::Block *lldb_object_ptr); 87 88 void AppendVariables(bool can_create, bool get_parent_variables, 89 lldb_private::VariableList *var_list); 90 91 lldb_private::Block *m_opaque_ptr; 92 }; 93 94 } // namespace lldb 95 96 #endif // LLDB_SBBlock_h_ 97