diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-05-27 09:43:44 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-05-27 09:43:44 +0000 |
| commit | 3afb2527cedec73809ed082706ebb6f733479bdd (patch) | |
| tree | 203079d56ce89b46aec3986b7a02acdaf964efdb | |
| parent | 88f48a9af32fe072a4eb0ac2d5980289221248a0 (diff) | |
| download | bcm5719-llvm-3afb2527cedec73809ed082706ebb6f733479bdd.tar.gz bcm5719-llvm-3afb2527cedec73809ed082706ebb6f733479bdd.zip | |
Parse function name from DWARF DW_AT_abstract_origin
A DW_TAG_subprogram entry can contain a reference to a
DW_AT_abstract_origin entry instead of duplicating the information
from it (e.g.: name) when the same function is inlined in some case
and not inlined in other cases.
This CL fixes name parsing for the case when the DW_TAG_subprogram
for the non inlined version contains just a reference to the
DW_AT_abstract_origin entry instead of the full information.
Differential revision: http://reviews.llvm.org/D10034
llvm-svn: 238307
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 6a8c4e6d57b..0ad1f1a3a95 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -1582,17 +1582,21 @@ DWARFDebugInfoEntry::GetName DWARFFormValue form_value; if (GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value)) return form_value.AsCString(&dwarf2Data->get_debug_str_data()); - else + else if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) { - if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) - { - DWARFCompileUnitSP cu_sp_ptr; - const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(), &cu_sp_ptr); - if (die) - return die->GetName(dwarf2Data, cu_sp_ptr.get()); - } + DWARFCompileUnitSP cu_sp_ptr; + const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(), &cu_sp_ptr); + if (die) + return die->GetName(dwarf2Data, cu_sp_ptr.get()); } - return NULL; + else if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) + { + DWARFCompileUnitSP cu_sp_ptr; + const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(), &cu_sp_ptr); + if (die) + return die->GetName(dwarf2Data, cu_sp_ptr.get()); + } + return nullptr; } |

