summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorEric Beckmann <ecbeckmann@google.com>2017-09-16 01:14:36 +0000
committerEric Beckmann <ecbeckmann@google.com>2017-09-16 01:14:36 +0000
commit913213c8ae6167de4b8ba92cbd71975761113096 (patch)
tree303f5fb3d082b085b65fc2068b53a8cfbce718bc /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parentb29a17ba21d3c19bf3cc5df2b979a9f67666ed54 (diff)
downloadbcm5719-llvm-913213c8ae6167de4b8ba92cbd71975761113096.tar.gz
bcm5719-llvm-913213c8ae6167de4b8ba92cbd71975761113096.zip
Revert "Fix Bug 30978 by emitting cv file checksums."
This reverts commit 6389e7aa724ea7671d096f4770f016c3d86b0d54. There is a bug in this implementation where the string value of the checksum is outputted, instead of the actual hex bytes. Therefore the checksum is incorrect, and this prevent pdbs from being loaded by visual studio. Revert this until the checksum is emitted correctly. llvm-svn: 313431
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index db72269983f..87aeb1f03dd 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -159,10 +159,7 @@ unsigned CodeViewDebug::maybeRecordFile(const DIFile *F) {
if (Insertion.second) {
// We have to compute the full filepath and emit a .cv_file directive.
StringRef FullPath = getFullFilepath(F);
- StringRef Checksum = F->getChecksum();
- DIFile::ChecksumKind ChecksumKind = F->getChecksumKind();
- bool Success = OS.EmitCVFileDirective(NextId, FullPath, Checksum,
- static_cast<unsigned>(ChecksumKind));
+ bool Success = OS.EmitCVFileDirective(NextId, FullPath);
(void)Success;
assert(Success && ".cv_file directive failed");
}
@@ -684,10 +681,8 @@ void CodeViewDebug::emitInlineeLinesSubsection() {
OS.AddComment("Inlinee lines subsection");
MCSymbol *InlineEnd = beginCVSubsection(DebugSubsectionKind::InlineeLines);
- // We emit the checksum info for files. This is used by debuggers to
- // determine if a pdb matches the source before loading it. Visual Studio,
- // for instance, will display a warning that the breakpoints are not valid if
- // the pdb does not match the source.
+ // We don't provide any extra file info.
+ // FIXME: Find out if debuggers use this info.
OS.AddComment("Inlinee lines signature");
OS.EmitIntValue(unsigned(InlineeLinesSignature::Normal), 4);
@@ -700,10 +695,13 @@ void CodeViewDebug::emitInlineeLinesSubsection() {
OS.AddComment("Inlined function " + SP->getName() + " starts at " +
SP->getFilename() + Twine(':') + Twine(SP->getLine()));
OS.AddBlankLine();
+ // The filechecksum table uses 8 byte entries for now, and file ids start at
+ // 1.
+ unsigned FileOffset = (FileId - 1) * 8;
OS.AddComment("Type index of inlined function");
OS.EmitIntValue(InlineeIdx.getIndex(), 4);
OS.AddComment("Offset into filechecksum table");
- OS.EmitCVFileChecksumOffsetDirective(FileId);
+ OS.EmitIntValue(FileOffset, 4);
OS.AddComment("Starting line number");
OS.EmitIntValue(SP->getLine(), 4);
}
OpenPOWER on IntegriCloud