diff options
| author | Greg Clayton <gclayton@apple.com> | 2013-07-15 21:10:17 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2013-07-15 21:10:17 +0000 |
| commit | 109f86860ae46f8a502760d5f21a580b109e8537 (patch) | |
| tree | 07d6f97b6d6f75fae6f37516981e76ad401f581a /lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp | |
| parent | 8ac2ec4043b39392e26f4d7be818b2b0a257d501 (diff) | |
| download | bcm5719-llvm-109f86860ae46f8a502760d5f21a580b109e8537.tar.gz bcm5719-llvm-109f86860ae46f8a502760d5f21a580b109e8537.zip | |
Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by:
1 - looking up the type basename in the type index
2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match
The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name.
llvm-svn: 186347
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp index 7d265beaab7..abf69190c93 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp @@ -82,7 +82,15 @@ DWARFDeclContext::operator==(const DWARFDeclContext& rhs) const for (pos = begin, rhs_pos = rhs_begin; pos != end; ++pos, ++rhs_pos) { if (pos->tag != rhs_pos->tag) + { + // Check for DW_TAG_structure_type and DW_TAG_class_type as they are often + // used interchangeably in GCC + if (pos->tag == DW_TAG_structure_type && rhs_pos->tag == DW_TAG_class_type) + continue; + if (pos->tag == DW_TAG_class_type && rhs_pos->tag == DW_TAG_structure_type) + continue; return false; + } } // The tags all match, now compare the names for (pos = begin, rhs_pos = rhs_begin; pos != end; ++pos, ++rhs_pos) |

