Skip to content

Commit 101fa45

Browse files
authored
[lldb] Fix mangled name being overwritten on type with DW_AT_specific…
[lldb] Fix mangled name being overwritten on type with DW_AT_specific…
2 parents c9e7e76 + 3901846 commit 101fa45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserSwift.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ lldb::TypeSP DWARFASTParserSwift::ParseTypeFromDWARF(const SymbolContext &sc,
103103
break;
104104
case llvm::dwarf::DW_AT_linkage_name:
105105
case llvm::dwarf::DW_AT_MIPS_linkage_name: {
106-
mangled_name.SetCString(form_value.AsCString());
106+
// This could be a type with DW_AT_specification, in which case,
107+
// don't overwrite the mangled name if it's already set (the
108+
// order of the attributes is deterministic, and the "specifier"
109+
// attributes will always come before the specified).
110+
if (mangled_name.IsEmpty())
111+
mangled_name.SetCString(form_value.AsCString());
107112
auto HasSpecificationOf = [&](){
108113
if (has_specification_of)
109114
return true;

0 commit comments

Comments
 (0)