From 69c2c51dd89965d234eec16e3a9353634831916b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 1 Jun 2018 15:39:13 +0900 Subject: 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 --- src/common/dwarf_cu_to_module.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/common/dwarf_cu_to_module.cc') diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index a16bee7d..38fc4c16 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -285,6 +285,10 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler { // 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 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( // fallthrough case Language::kDontDemangle: demangled_name_.clear(); + raw_name_ = AddStringToPool(data); break; } break; @@ -392,6 +397,8 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { 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 -- cgit v1.2.1