From 85fe17535332eb54b076109c91164b0870d92a9a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 4 Feb 2016 17:57:12 +0000 Subject: [PATCH] Correctly handle {Always,Never}StepIntoLine llvm-svn: 259806 --- include/llvm/DebugInfo/CodeView/Line.h | 1 + tools/llvm-readobj/COFFDumper.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/llvm/DebugInfo/CodeView/Line.h b/include/llvm/DebugInfo/CodeView/Line.h index 80a3ec05a01..bf2d55096b0 100644 --- a/include/llvm/DebugInfo/CodeView/Line.h +++ b/include/llvm/DebugInfo/CodeView/Line.h @@ -35,6 +35,7 @@ public: }; LineInfo(uint32_t StartLine, uint32_t EndLine, bool IsStatement); + LineInfo(uint32_t LineData) : LineData(LineData) {} uint32_t getStartLine() const { return LineData & StartLineMask; } diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index 078e0b16dea..ace5be8bedc 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -1154,14 +1154,15 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName, char Buffer[32]; format("+0x%X", PC).snprint(Buffer, 32); ListScope PCScope(W, Buffer); - uint32_t LineNumberStart = LineData & codeview::LineInfo::StartLineMask; - uint32_t LineNumberEndDelta = - (LineData & codeview::LineInfo::EndLineDeltaMask) >> - codeview::LineInfo::EndLineDeltaShift; - bool IsStatement = LineData & codeview::LineInfo::StatementFlag; - W.printNumber("LineNumberStart", LineNumberStart); - W.printNumber("LineNumberEndDelta", LineNumberEndDelta); - W.printBoolean("IsStatement", IsStatement); + LineInfo LI(LineData); + if (LI.isAlwaysStepInto()) + W.printString("StepInto", StringRef("Always")); + else if (LI.isNeverStepInto()) + W.printString("StepInto", StringRef("Never")); + else + W.printNumber("LineNumberStart", LI.getStartLine()); + W.printNumber("LineNumberEndDelta", LI.getLineDelta()); + W.printBoolean("IsStatement", LI.isStatement()); if (HasColumnInformation && ColumnDE.isValidOffsetForDataOfSize(ColumnOffset, 4)) { uint16_t ColStart = ColumnDE.getU16(&ColumnOffset);