diff options
author | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-10-05 21:47:55 +0000 |
---|---|---|
committer | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-10-05 21:47:55 +0000 |
commit | 4fcccf68cbb32bec2c041168fe8fbd5b11550ac1 (patch) | |
tree | fd9ceb12ecf2b86333e663bceb396fafc520ede3 /src/common/dwarf_cu_to_module.cc | |
parent | Update dump_syms to correctly filter on cpu subtype. (diff) | |
download | breakpad-4fcccf68cbb32bec2c041168fe8fbd5b11550ac1.tar.xz |
If a specification DIE has a DW_AT_MIPS_linkage_name attribute, don't fail
to add it to the specifications table. Record the fully-qualified name
provided by the demangler in the table.
A=Rafael Ávila de Espíndola <respindola@mozilla.com> R=jimb at https://breakpad.appspot.
com/478004/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1062 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/dwarf_cu_to_module.cc')
-rw-r--r-- | src/common/dwarf_cu_to_module.cc | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index ef2489c8..081260c6 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -74,6 +74,9 @@ using std::vector; // A Specification holds information gathered from a declaration DIE that // we may need if we find a DW_AT_specification link pointing to it. struct DwarfCUToModule::Specification { + // The qualified name that can be found by demangling DW_AT_MIPS_linkage_name. + string qualified_name; + // The name of the enclosing scope, or the empty string if there is none. string enclosing_name; @@ -314,38 +317,54 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( } string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { - // Use DW_AT_MIPS_linkage_name if it is available. It is already qualified, - // so there is no need to add enclosing_name. - if (!demangled_name_.empty()) - return demangled_name_; + // Use the demangled name, if one is available. Demangled names are + // preferable to those inferred from the DWARF structure because they + // include argument types. + const string *qualified_name = NULL; + if (!demangled_name_.empty()) { + // Found it is this DIE. + qualified_name = &demangled_name_; + } else if (specification_ && !specification_->qualified_name.empty()) { + // Found it on the specification. + qualified_name = &specification_->qualified_name; + } - // Find our unqualified name. If the DIE has its own DW_AT_name - // attribute, then use that; otherwise, check our specification. const string *unqualified_name; - if (name_attribute_.empty() && specification_) - unqualified_name = &specification_->unqualified_name; - else - unqualified_name = &name_attribute_; - - // Find the name of our enclosing context. If we have a - // specification, it's the specification's enclosing context that - // counts; otherwise, use this DIE's context. const string *enclosing_name; - if (specification_) - enclosing_name = &specification_->enclosing_name; - else - enclosing_name = &parent_context_->name; + if (!qualified_name) { + // Find our unqualified name. If the DIE has its own DW_AT_name + // attribute, then use that; otherwise, check our specification. + if (name_attribute_.empty() && specification_) + unqualified_name = &specification_->unqualified_name; + else + unqualified_name = &name_attribute_; + + // Find the name of our enclosing context. If we have a + // specification, it's the specification's enclosing context that + // counts; otherwise, use this DIE's context. + if (specification_) + enclosing_name = &specification_->enclosing_name; + else + enclosing_name = &parent_context_->name; + } // If this DIE was marked as a declaration, record its names in the // specification table. if (declaration_) { FileContext *file_context = cu_context_->file_context; Specification spec; - spec.enclosing_name = *enclosing_name; - spec.unqualified_name = *unqualified_name; + if (qualified_name) + spec.qualified_name = *qualified_name; + else { + spec.enclosing_name = *enclosing_name; + spec.unqualified_name = *unqualified_name; + } file_context->file_private->specifications[offset_] = spec; } + if (qualified_name) + return *qualified_name; + // Combine the enclosing name and unqualified name to produce our // own fully-qualified name. return cu_context_->language->MakeQualifiedName(*enclosing_name, |