summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/MCCodeView.cpp1
-rw-r--r--llvm/test/MC/COFF/cv-inline-linetable-unlikely.s5
-rw-r--r--llvm/test/MC/COFF/cv-loc-unreachable-2.s2
-rw-r--r--llvm/test/MC/COFF/cv-loc-unreachable.s2
-rw-r--r--llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp4
5 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCCodeView.cpp b/llvm/lib/MC/MCCodeView.cpp
index b2983c11e34..1a71b542bd0 100644
--- a/llvm/lib/MC/MCCodeView.cpp
+++ b/llvm/lib/MC/MCCodeView.cpp
@@ -535,6 +535,7 @@ void CodeViewContext::encodeInlineLineTable(MCAsmLayout &Layout,
unsigned Length = computeLabelDiff(Layout, LastLabel, Loc.getLabel());
compressAnnotation(BinaryAnnotationsOpCode::ChangeCodeLength, Buffer);
compressAnnotation(Length, Buffer);
+ LastLabel = Loc.getLabel();
}
HaveOpenRange = false;
continue;
diff --git a/llvm/test/MC/COFF/cv-inline-linetable-unlikely.s b/llvm/test/MC/COFF/cv-inline-linetable-unlikely.s
index 3f693ee6329..a12f6d32ad2 100644
--- a/llvm/test/MC/COFF/cv-inline-linetable-unlikely.s
+++ b/llvm/test/MC/COFF/cv-inline-linetable-unlikely.s
@@ -36,12 +36,11 @@
# ASM-NEXT: 2b: 0f 0b ud2
# End inline loc
-# CODEVIEW: S_INLINESITE [size = 26]
+# CODEVIEW: S_INLINESITE [size = 24]
# CODEVIEW-NEXT: inlinee = 0x1002 (f), parent = 0, end = 0
# CODEVIEW-NEXT: 0B2E code 0xE (+0xE) line 1 (+1)
# CODEVIEW-NEXT: 0409 code end 0x17 (+0x9)
-# CODEVIEW-NEXT: 0602 line 2 (+1)
-# CODEVIEW-NEXT: 0318 code 0x26 (+0x18)
+# CODEVIEW-NEXT: 0B2F code 0x26 (+0xF) line 2 (+1)
# CODEVIEW-NEXT: 0407 code end 0x2D (+0x7)
.text
diff --git a/llvm/test/MC/COFF/cv-loc-unreachable-2.s b/llvm/test/MC/COFF/cv-loc-unreachable-2.s
index e13ad84a814..66e8da4fa14 100644
--- a/llvm/test/MC/COFF/cv-loc-unreachable-2.s
+++ b/llvm/test/MC/COFF/cv-loc-unreachable-2.s
@@ -25,7 +25,7 @@
# CODEVIEW-NEXT: inlinee = 0x1002 (do_exit), parent = 0, end = 0
# CODEVIEW-NEXT: 0602 line 1 (+1)
# CODEVIEW-NEXT: 0409 code end 0x9 (+0x9)
-# CODEVIEW-NEXT: 0B2A code 0xA (+0xA) line 2 (+1)
+# CODEVIEW-NEXT: 0B21 code 0xA (+0x1) line 2 (+1)
# CODEVIEW-NEXT: 0B28 code 0x12 (+0x8) line 3 (+1)
# CODEVIEW-NEXT: 0400 code end 0x12 (+0x0)
diff --git a/llvm/test/MC/COFF/cv-loc-unreachable.s b/llvm/test/MC/COFF/cv-loc-unreachable.s
index bd6f8f75a8c..7a14a2d6002 100644
--- a/llvm/test/MC/COFF/cv-loc-unreachable.s
+++ b/llvm/test/MC/COFF/cv-loc-unreachable.s
@@ -36,7 +36,7 @@
# CODEVIEW-NEXT: inlinee = 0x1002 (do_exit), parent = 0, end = 0
# CODEVIEW-NEXT: 0602 line 1 (+1)
# CODEVIEW-NEXT: 0409 code end 0x9 (+0x9)
-# CODEVIEW-NEXT: 0B2A code 0xA (+0xA) line 2 (+1)
+# CODEVIEW-NEXT: 0B21 code 0xA (+0x1) line 2 (+1)
# CODEVIEW-NEXT: 0B28 code 0x12 (+0x8) line 3 (+1)
# CODEVIEW-NEXT: 0400 code end 0x12 (+0x0)
diff --git a/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp b/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
index d3c3f3da9c0..720d7396601 100644
--- a/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
+++ b/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
@@ -689,6 +689,10 @@ Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, InlineSiteSym &IS) {
break;
case BinaryAnnotationsOpCode::ChangeCodeLength:
formatCodeLength(Annot.U1);
+ // Apparently this annotation updates the code offset. It's hard to make
+ // MSVC produce this opcode, but clang uses it, and debuggers seem to use
+ // this interpretation.
+ CodeOffset += Annot.U1;
break;
case BinaryAnnotationsOpCode::ChangeCodeOffsetAndLineOffset:
formatCodeOffset(Annot.U1);
OpenPOWER on IntegriCloud