summaryrefslogtreecommitdiffstats
path: root/lib/DebugInfo/DWARFContext.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-07-17 15:28:35 +0000
committerAlexey Samsonov <samsonov@google.com>2012-07-17 15:28:35 +0000
commit9d26b0ba06479d9debadebce19344169f72407dd (patch)
tree45245cc51de114c3919becf1b93ac1447d8483c1 /lib/DebugInfo/DWARFContext.cpp
parent4f0c69623c10a3a49f6926fd53694ee532e06a85 (diff)
downloadexternal_llvm-9d26b0ba06479d9debadebce19344169f72407dd.zip
external_llvm-9d26b0ba06479d9debadebce19344169f72407dd.tar.gz
external_llvm-9d26b0ba06479d9debadebce19344169f72407dd.tar.bz2
Improve behavior of DebugInfoEntryMinimal::getSubprogramName() introduced in r159512.
To fetch a subprogram name we should not only inspect the DIE for this subprogram, but optionally inspect its specification, or its abstract origin (even if there is no inlining), or even specification of an abstract origin. Reviewed by Benjamin Kramer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r--lib/DebugInfo/DWARFContext.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp
index 6be230e..08e5db2 100644
--- a/lib/DebugInfo/DWARFContext.cpp
+++ b/lib/DebugInfo/DWARFContext.cpp
@@ -155,8 +155,10 @@ DILineInfo DWARFContext::getLineInfoForAddress(uint64_t address,
if (specifier.needs(DILineInfoSpecifier::FunctionName)) {
const DWARFDebugInfoEntryMinimal *function_die =
cu->getFunctionDIEForAddress(address);
- if (function_die)
- functionName = function_die->getSubprogramName(cu);
+ if (function_die) {
+ if (const char *name = function_die->getSubprogramName(cu))
+ functionName = name;
+ }
}
if (specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
// Get the line table for this compile unit.