From 4346ae1a058c257bbd09e335e3a318d9e99fd2f1 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sat, 29 Apr 2017 00:03:32 +0000 Subject: [PATCH] [llvm-readobj] Fix incorrect printing of CV column info. llvm-svn: 301720 --- llvm/tools/llvm-readobj/COFFDumper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index ac28c1a7cb8b..280359ee2e74 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -906,6 +906,7 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName, ListScope S(W, "FilenameSegment"); printFileNameForOffset("Filename", Entry.NameIndex); + uint32_t ColumnIndex = 0; for (const auto &Line : Entry.LineNumbers) { if (Line.Offset >= LineInfo.header()->CodeSize) { error(object_error::parse_failed); @@ -925,8 +926,9 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName, W.printNumber("LineNumberEndDelta", LI.getLineDelta()); W.printBoolean("IsStatement", LI.isStatement()); if (LineInfo.header()->Flags & HaveColumns) { - W.printNumber("ColStart", Entry.Columns[0].StartColumn); - W.printNumber("ColEnd", Entry.Columns[0].EndColumn); + W.printNumber("ColStart", Entry.Columns[ColumnIndex].StartColumn); + W.printNumber("ColEnd", Entry.Columns[ColumnIndex].EndColumn); + ++ColumnIndex; } } }