[Lldb-commits] [PATCH] D40469: DWZ 06/12: Mask DW_TAG_partial_unit as DW_TAG_compile_unit for Tag()
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Nov 26 05:11:02 PST 2017
jankratochvil created this revision.
Herald added a subscriber: JDevlieghere.
Code commonly checks if the parent DIE is DW_TAG_compile_unit. But DW_TAG_partial_unit also acts as DW_TAG_compile_unit for DWZ as DWZ is using DW_TAG_imported_unit only at the top unit level.
All DWZ patches are also applied in: git clone -b dwz git://git.jankratochvil.net/lldb
https://reviews.llvm.org/D40469
Files:
source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
source/Plugins/SymbolFile/DWARF/DWARFDIE.h
source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2031,7 +2031,9 @@
&global_index, &type_index,
&namespace_index](size_t cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
- if (dwarf_cu) {
+ if (dwarf_cu
+ && dwarf_cu->GetCompileUnitDIEOnly().TagOrig()
+ == DW_TAG_compile_unit) {
dwarf_cu->Index(
function_basename_index[cu_idx], function_fullname_index[cu_idx],
function_method_index[cu_idx], function_selector_index[cu_idx],
Index: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
===================================================================
--- source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -193,7 +193,11 @@
const DWARFCompileUnit *cu,
lldb::offset_t &file_offset) const;
- dw_tag_t Tag() const { return m_tag; }
+ dw_tag_t TagOrig() const { return m_tag; }
+
+ dw_tag_t Tag() const {
+ return m_tag != DW_TAG_partial_unit ? m_tag : dw_tag_t(DW_TAG_compile_unit);
+ }
bool IsNULL() const { return m_abbr_idx == 0; }
Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.h
===================================================================
--- source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -89,6 +89,8 @@
//----------------------------------------------------------------------
// Accessing information about a DIE
//----------------------------------------------------------------------
+ dw_tag_t TagOrig() const;
+
dw_tag_t Tag() const;
const char *GetTagAsCString() const;
Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -39,6 +39,13 @@
return DIERef(cu_offset, m_die->GetOffset(m_cu));
}
+dw_tag_t DWARFDIE::TagOrig() const {
+ if (m_die)
+ return m_die->TagOrig();
+ else
+ return 0;
+}
+
dw_tag_t DWARFDIE::Tag() const {
if (m_die)
return m_die->Tag();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40469.124295.patch
Type: text/x-patch
Size: 2427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171126/93296a0a/attachment.bin>
More information about the lldb-commits
mailing list