diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-05-17 00:07:48 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-05-17 00:07:48 +0000 |
commit | bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4 (patch) | |
tree | 766b472982f1c517f2b44e63609987a0163b3fc6 /lib/DebugInfo | |
parent | 2d1fa5f718bc53d9b3867371f0941889f02bea3a (diff) | |
download | llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.gz llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.bz2 llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.xz |
[DWARF parser] Teach DIContext to fetch short (non-linkage) function names for a given address.
Change --functions option in llvm-symbolizer tool to accept
values "none", "short" or "linkage". Update the tests and docs
accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r-- | lib/DebugInfo/DWARFDebugInfoEntry.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp index d2b529346f..b811ed7064 100644 --- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -277,13 +277,15 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U, FunctionNameKind Kind) const { if (!isSubroutineDIE() || Kind == FunctionNameKind::None) return nullptr; - // Try to get mangled name if possible. - if (const char *name = - getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr)) - return name; - if (const char *name = getAttributeValueAsString(U, DW_AT_linkage_name, - nullptr)) - return name; + // Try to get mangled name only if it was asked for. + if (Kind == FunctionNameKind::LinkageName) { + if (const char *name = + getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr)) + return name; + if (const char *name = + getAttributeValueAsString(U, DW_AT_linkage_name, nullptr)) + return name; + } if (const char *name = getAttributeValueAsString(U, DW_AT_name, nullptr)) return name; // Try to get name from specification DIE. |