summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-02-08 23:08:02 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-02-08 23:08:02 +0000
commitceafcd41cf27ba94dbff62710ab03cb22b0d23a0 (patch)
treeac8e91e70660103a305f953f08f55c0bec71d9d8 /llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
parent41ffb30716e94f575a38647dac02c80b71f9bff1 (diff)
downloadbcm5719-llvm-ceafcd41cf27ba94dbff62710ab03cb22b0d23a0.tar.gz
bcm5719-llvm-ceafcd41cf27ba94dbff62710ab03cb22b0d23a0.zip
[DWARFv5] Fix dumper to show the file table starts at index 0.
Emitting the correct (root of compilation) file at index 0 will be posted for review later; I wanted to get this minor change out of the way first. llvm-svn: 324669
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
index 38272b6afdf..8986af26c03 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -93,9 +93,12 @@ void DWARFDebugLine::Prologue::dump(raw_ostream &OS,
OS << " Dir Mod Time File Len File Name\n"
<< " ---- ---------- ---------- -----------"
"----------------\n";
+ // DWARF v5 starts file indexes at 0.
+ uint32_t FileBase = getVersion() >= 5 ? 0 : 1;
for (uint32_t I = 0; I != FileNames.size(); ++I) {
const FileNameEntry &FileEntry = FileNames[I];
- OS << format("file_names[%3u] %4" PRIu64 " ", I + 1, FileEntry.DirIdx);
+ OS << format("file_names[%3u] %4" PRIu64 " ", I + FileBase,
+ FileEntry.DirIdx);
if (HasMD5)
OS << FileEntry.Checksum.digest();
else
OpenPOWER on IntegriCloud