summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h59
1 files changed, 51 insertions, 8 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
index 6e8a921bb9f..f97ad88eb39 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -41,6 +41,7 @@ typedef std::multimap<uint32_t, const DWARFDebugInfoEntry*> UInt32ToDIEMMap;
typedef UInt32ToDIEMMap::iterator UInt32ToDIEMMapIter;
typedef UInt32ToDIEMMap::const_iterator UInt32ToDIEMMapConstIter;
+#define DIE_SIBLING_IDX_BITSIZE 31
#define DIE_ABBR_IDX_BITSIZE 15
class DWARFDebugInfoEntry
@@ -107,11 +108,24 @@ public:
m_offset (DW_INVALID_OFFSET),
m_parent_idx (0),
m_sibling_idx (0),
+ m_empty_children(false),
m_abbr_idx (0),
- m_has_children (false)
+ m_has_children (false),
+ m_tag (0)
{
}
+ void Clear ()
+ {
+ m_offset = DW_INVALID_OFFSET;
+ m_parent_idx = 0;
+ m_sibling_idx = 0;
+ m_empty_children = false;
+ m_abbr_idx = 0;
+ m_has_children = false;
+ m_tag = 0;
+ }
+
bool Contains (const DWARFDebugInfoEntry *die) const;
void BuildAddressRangeTable(
@@ -323,8 +337,8 @@ public:
// We know we are kept in a vector of contiguous entries, so we know
// we don't need to store our child pointer, if we have a child it will
// be the next entry in the list...
- DWARFDebugInfoEntry* GetFirstChild() { return HasChildren() ? this + 1 : NULL; }
- const DWARFDebugInfoEntry* GetFirstChild() const { return HasChildren() ? this + 1 : NULL; }
+ DWARFDebugInfoEntry* GetFirstChild() { return (HasChildren() && !m_empty_children) ? this + 1 : NULL; }
+ const DWARFDebugInfoEntry* GetFirstChild() const { return (HasChildren() && !m_empty_children) ? this + 1 : NULL; }
void
SetParent (DWARFDebugInfoEntry* parent)
@@ -352,13 +366,42 @@ public:
m_sibling_idx = 0;
}
+ void
+ SetSiblingIndex (uint32_t idx)
+ {
+ m_sibling_idx = idx;
+ }
+
+ void
+ SetParentIndex (uint32_t idx)
+ {
+ m_parent_idx = idx;
+ }
+
+ bool
+ GetEmptyChildren () const
+ {
+ return m_empty_children;
+ }
+
+ void
+ SetEmptyChildren (bool b)
+ {
+ m_empty_children = b;
+ }
+
+ static void
+ DumpDIECollection (lldb_private::Stream &strm,
+ DWARFDebugInfoEntry::collection &die_collection);
+
protected:
- dw_offset_t m_offset; // Offset within the .debug_info of the start of this entry
- uint32_t m_parent_idx; // How many to subtract from "this" to get the parent. If zero this die has no parent
- uint32_t m_sibling_idx; // How many to add to "this" to get the sibling.
+ dw_offset_t m_offset; // Offset within the .debug_info of the start of this entry
+ uint32_t m_parent_idx; // How many to subtract from "this" to get the parent. If zero this die has no parent
+ uint32_t m_sibling_idx:31, // How many to add to "this" to get the sibling.
+ m_empty_children:1; // If a DIE says it had children, yet it just contained a NULL tag, this will be set.
uint32_t m_abbr_idx:DIE_ABBR_IDX_BITSIZE,
- m_has_children:1,
- m_tag:16;
+ m_has_children:1, // Set to 1 if this DIE has children
+ m_tag:16; // A copy of the DW_TAG value so we don't have to go through the compile unit abbrev table
};
OpenPOWER on IntegriCloud