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>
This commit is contained in:
Mike Hommey 2018-06-01 15:39:13 +09:00 committed by Ted Mielczarek
parent 7b3afa9258
commit 69c2c51dd8

View file

@ -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