Fall back to the raw symbol name from DW_AT_MIPS_linkage_name when there is nothing else
When DW_AT_MIPS_linkage_name doesn't demangle, breakpad currently throws
the symbol completely, but in some cases, there is no DW_AT_name or
DW_AT_abstract_origin to figure out a name, and the raw value from
DW_AT_MIPS_linkage_name is still better than nothing. Fall back to that
in when there is nothing else.
R=ted@mielczarek.org
Change-Id: I5cc7580244f2b99f5f1f279d09b904031cae1a37
Reviewed-on: https://chromium-review.googlesource.com/1082176
Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc
index a16bee7..38fc4c1 100644
--- a/src/common/dwarf_cu_to_module.cc
+++ b/src/common/dwarf_cu_to_module.cc
@@ -285,6 +285,10 @@
// string if the DIE has no such attribute or its content could not be
// demangled.
string demangled_name_;
+
+ // The non-demangled value of the DW_AT_MIPS_linkage_name attribute,
+ // it its content count not be demangled.
+ string raw_name_;
};
void DwarfCUToModule::GenericDIEHandler::ProcessAttributeUnsigned(
@@ -362,6 +366,7 @@
// fallthrough
case Language::kDontDemangle:
demangled_name_.clear();
+ raw_name_ = AddStringToPool(data);
break;
}
break;
@@ -392,6 +397,8 @@
unqualified_name = &name_attribute_;
else if (specification_)
unqualified_name = &specification_->unqualified_name;
+ else if (!raw_name_.empty())
+ unqualified_name = &raw_name_;
// Find the name of the enclosing context. If this DIE has a
// specification, it's the specification's enclosing context that