summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2014-09-22 12:36:04 +0000
committerFrederic Riss <friss@apple.com>2014-09-22 12:36:04 +0000
commit955724e3f5f3e8c5dc68a4594682839c811b63b4 (patch)
treeba03daacf1905d675f7e8efc788d7f990d6ca4d1 /llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
parent58ed53cfcd974e7f062346325a9a42d949944b93 (diff)
downloadbcm5719-llvm-955724e3f5f3e8c5dc68a4594682839c811b63b4.tar.gz
bcm5719-llvm-955724e3f5f3e8c5dc68a4594682839c811b63b4.zip
[dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values
Reviewers: dblaikie samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5192 llvm-svn: 218246
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index 192cd3cdacf..81a976e4da1 100644
--- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
@@ -31,7 +31,7 @@ static const DWARFUnit *findUnitAndExtractFast(DWARFDebugInfoEntryMinimal &DIE,
return (Unit && DIE.extractFast(Unit, Offset)) ? Unit : nullptr;
}
-void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, const DWARFUnit *u,
+void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, DWARFUnit *u,
unsigned recurseDepth,
unsigned indent) const {
DataExtractor debug_info_data = u->getDebugInfoExtractor();
@@ -74,7 +74,7 @@ void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, const DWARFUnit *u,
}
void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,
- const DWARFUnit *u,
+ DWARFUnit *u,
uint32_t *offset_ptr,
uint16_t attr, uint16_t form,
unsigned indent) const {
@@ -99,7 +99,17 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,
OS << "\t(";
const char *Name = nullptr;
- if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
+ std::string File;
+ if (attr == DW_AT_decl_file || attr == DW_AT_call_file) {
+ if (const auto *LT = u->getContext().getLineTableForUnit(u))
+ if (LT->getFileNameByIndex(
+ formValue.getAsUnsignedConstant().getValue(),
+ u->getCompilationDir(),
+ DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
+ File = '"' + File + '"';
+ Name = File.c_str();
+ }
+ } else if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
Name = AttributeValueString(attr, *Val);
if (Name) {
OpenPOWER on IntegriCloud