summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-14 06:24:24 +0000
committerZachary Turner <zturner@google.com>2017-06-14 06:24:24 +0000
commit0085dce221b820f4287b6a2bbf428500501ece39 (patch)
tree9db447d1534241dbb854f7fe446b332392405a0a /llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp
parent9cac9ad9d4b835f7f1da76dde865e358363e1e75 (diff)
downloadbcm5719-llvm-0085dce221b820f4287b6a2bbf428500501ece39.tar.gz
bcm5719-llvm-0085dce221b820f4287b6a2bbf428500501ece39.zip
Revert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
This is causing failures on linux bots with an invalid stream read. It doesn't repro in any configuration on Windows, so reverting until I have a chance to investigate on Linux. llvm-svn: 305371
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp')
-rw-r--r--llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp b/llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp
index 9b824333369..8550107741c 100644
--- a/llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp
+++ b/llvm/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp
@@ -26,9 +26,40 @@
using namespace llvm;
using namespace llvm::codeview;
-Error llvm::codeview::visitDebugSubsection(
- const DebugSubsectionRecord &R, DebugSubsectionVisitor &V,
- const StringsAndChecksumsRef &State) {
+DebugSubsectionState::DebugSubsectionState() {}
+
+DebugSubsectionState::DebugSubsectionState(
+ const DebugStringTableSubsectionRef &Strings)
+ : Strings(&Strings) {}
+
+DebugSubsectionState::DebugSubsectionState(
+ const DebugStringTableSubsectionRef &Strings,
+ const DebugChecksumsSubsectionRef &Checksums)
+ : Strings(&Strings), Checksums(&Checksums) {}
+
+void DebugSubsectionState::initializeStrings(const DebugSubsectionRecord &SR) {
+ assert(SR.kind() == DebugSubsectionKind::StringTable);
+ assert(!Strings && "Found a string table even though we already have one!");
+
+ OwnedStrings = llvm::make_unique<DebugStringTableSubsectionRef>();
+ consumeError(OwnedStrings->initialize(SR.getRecordData()));
+ Strings = OwnedStrings.get();
+}
+
+void DebugSubsectionState::initializeChecksums(
+ const DebugSubsectionRecord &FCR) {
+ assert(FCR.kind() == DebugSubsectionKind::FileChecksums);
+ if (Checksums)
+ return;
+
+ OwnedChecksums = llvm::make_unique<DebugChecksumsSubsectionRef>();
+ consumeError(OwnedChecksums->initialize(FCR.getRecordData()));
+ Checksums = OwnedChecksums.get();
+}
+
+Error llvm::codeview::visitDebugSubsection(const DebugSubsectionRecord &R,
+ DebugSubsectionVisitor &V,
+ const DebugSubsectionState &State) {
BinaryStreamReader Reader(R.getRecordData());
switch (R.kind()) {
case DebugSubsectionKind::Lines: {
OpenPOWER on IntegriCloud