summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorEvgenii Stepanov <eugenis@google.com>2019-11-22 18:04:58 -0800
committerEvgenii Stepanov <eugenis@google.com>2019-11-25 15:06:07 -0800
commit1b42cc0df160b2c741a258331e647472c370eb66 (patch)
treeed7415cb355b61488347dfe77a3f317dac99478a /llvm/lib/DebugInfo
parent9f60820d8416a3e6839624839301a491ddb5d2a0 (diff)
downloadbcm5719-llvm-1b42cc0df160b2c741a258331e647472c370eb66.tar.gz
bcm5719-llvm-1b42cc0df160b2c741a258331e647472c370eb66.zip
llvm-symbolizer: fix handling of DW_AT_specification in FRAME.
Summary: Use getSubroutineName() to the the subrouting name; this function knows how to handle cases when DW_TAG_subprogram refers to an earlier declaration: 0x00000050: DW_TAG_subprogram DW_AT_linkage_name ("_ZN1A1fEv") DW_AT_name ("f") ... 0x00000067: DW_TAG_subprogram DW_AT_low_pc (0x0000000000000000) DW_AT_high_pc (0x0000000000000020) DW_AT_specification (0x00000050 "_ZN1A1fEv") ... 0x0000008c: DW_TAG_variable Reviewers: pcc, vitalybuka, jdoerfert Subscribers: srhines, hiraditya, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70630
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFContext.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 0084d3167d5..4e70e232a9b 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1094,9 +1094,8 @@ void DWARFContext::addLocalsForDie(DWARFCompileUnit *CU, DWARFDie Subprogram,
if (Die.getTag() == DW_TAG_variable ||
Die.getTag() == DW_TAG_formal_parameter) {
DILocal Local;
- if (auto NameAttr = Subprogram.find(DW_AT_name))
- if (Optional<const char *> Name = NameAttr->getAsCString())
- Local.FunctionName = *Name;
+ if (const char *Name = Subprogram.getSubroutineName(DINameKind::ShortName))
+ Local.FunctionName = Name;
Optional<unsigned> FrameBaseReg;
if (auto FrameBase = Subprogram.find(DW_AT_frame_base))
OpenPOWER on IntegriCloud