diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h index f35af6e7d498..3019e1767f18 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h @@ -6,13 +6,14 @@ // //===----------------------------------------------------------------------===// -#ifndef SymbolFileDWARF_DWARFDebugInfoEntry_h_ -#define SymbolFileDWARF_DWARFDebugInfoEntry_h_ +#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFOENTRY_H +#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFOENTRY_H #include "SymbolFileDWARF.h" #include "llvm/ADT/SmallVector.h" #include "DWARFAbbreviationDeclaration.h" +#include "DWARFBaseDIE.h" #include "DWARFDebugAbbrev.h" #include "DWARFDebugRanges.h" #include <map> @@ -41,23 +42,17 @@ public: bool operator==(const DWARFDebugInfoEntry &rhs) const; bool operator!=(const DWARFDebugInfoEntry &rhs) const; - void BuildAddressRangeTable(const DWARFUnit *cu, - DWARFDebugAranges *debug_aranges) const; - void BuildFunctionAddressRangeTable(const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const; bool Extract(const lldb_private::DWARFDataExtractor &data, const DWARFUnit *cu, lldb::offset_t *offset_ptr); - bool LookupAddress(const dw_addr_t address, DWARFUnit *cu, - DWARFDebugInfoEntry **function_die, - DWARFDebugInfoEntry **block_die); - - size_t GetAttributes(const DWARFUnit *cu, - DWARFAttributes &attrs, - uint32_t curr_depth = 0) - const; // "curr_depth" for internal use only, don't set this yourself!!! + using Recurse = DWARFBaseDIE::Recurse; + size_t GetAttributes(const DWARFUnit *cu, DWARFAttributes &attrs, + Recurse recurse = Recurse::yes) const { + return GetAttributes(cu, attrs, recurse, 0 /* curr_depth */); + } dw_offset_t GetAttributeValue(const DWARFUnit *cu, const dw_attr_t attr, @@ -106,15 +101,6 @@ public: const char *GetQualifiedName(DWARFUnit *cu, const DWARFAttributes &attributes, std::string &storage) const; - void Dump(const DWARFUnit *cu, lldb_private::Stream &s, - uint32_t recurse_depth) const; - - static void - DumpAttribute(const DWARFUnit *cu, - const lldb_private::DWARFDataExtractor &data, - lldb::offset_t *offset_ptr, lldb_private::Stream &s, - dw_attr_t attr, DWARFFormValue &form_value); - bool GetDIENamesAndRanges( DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &rangeList, int &decl_file, int &decl_line, @@ -162,8 +148,7 @@ public: return HasChildren() ? this + 1 : nullptr; } - void GetDWARFDeclContext(DWARFUnit *cu, - DWARFDeclContext &dwarf_decl_ctx) const; + DWARFDeclContext GetDWARFDeclContext(DWARFUnit *cu) const; DWARFDIE GetParentDeclContextDIE(DWARFUnit *cu) const; DWARFDIE GetParentDeclContextDIE(DWARFUnit *cu, @@ -172,7 +157,15 @@ public: void SetSiblingIndex(uint32_t idx) { m_sibling_idx = idx; } void SetParentIndex(uint32_t idx) { m_parent_idx = idx; } + // This function returns true if the variable scope is either + // global or (file-static). It will return false for static variables + // that are local to a function, as they have local scope. + bool IsGlobalOrStaticScopeVariable() const; + protected: + static DWARFDeclContext + GetDWARFDeclContextStatic(const DWARFDebugInfoEntry *die, DWARFUnit *cu); + dw_offset_t m_offset; // Offset within the .debug_info/.debug_types uint32_t m_parent_idx; // How many to subtract from "this" to get the parent. // If zero this die has no parent @@ -185,6 +178,10 @@ protected: /// A copy of the DW_TAG value so we don't have to go through the compile /// unit abbrev table dw_tag_t m_tag = llvm::dwarf::DW_TAG_null; + +private: + size_t GetAttributes(const DWARFUnit *cu, DWARFAttributes &attrs, + Recurse recurse, uint32_t curr_depth) const; }; -#endif // SymbolFileDWARF_DWARFDebugInfoEntry_h_ +#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFOENTRY_H |