summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-23 23:08:57 +0000
committerZachary Turner <zturner@google.com>2017-06-23 23:08:57 +0000
commitfa33282774ad7e58b29f5351e5e4acdbc1d875ec (patch)
treef2b5a63593aefdb648a93f0e72b52a4802299220 /llvm/lib/DebugInfo
parent86c664f9d7b26351f881f5be63ac065df2cb3eac (diff)
downloadbcm5719-llvm-fa33282774ad7e58b29f5351e5e4acdbc1d875ec.tar.gz
bcm5719-llvm-fa33282774ad7e58b29f5351e5e4acdbc1d875ec.zip
[llvm-pdbutil] Dump raw bytes of module symbols and debug chunks.
llvm-svn: 306179
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
index 4186f2eb6ba..83c56574a16 100644
--- a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
@@ -47,15 +47,19 @@ Error ModuleDebugStreamRef::reload() {
if (auto EC = Reader.readInteger(Signature))
return EC;
- if (auto EC = Reader.readArray(SymbolsSubstream, SymbolSize - 4))
+ if (auto EC = Reader.readSubstream(SymbolsSubstream, SymbolSize - 4))
return EC;
-
- if (auto EC = Reader.readStreamRef(C11LinesSubstream, C11Size))
+ if (auto EC = Reader.readSubstream(C11LinesSubstream, C11Size))
+ return EC;
+ if (auto EC = Reader.readSubstream(C13LinesSubstream, C13Size))
return EC;
- if (auto EC = Reader.readStreamRef(C13LinesSubstream, C13Size))
+
+ BinaryStreamReader SymbolReader(SymbolsSubstream.StreamData);
+ if (auto EC =
+ SymbolReader.readArray(SymbolArray, SymbolReader.bytesRemaining()))
return EC;
- BinaryStreamReader SubsectionsReader(C13LinesSubstream);
+ BinaryStreamReader SubsectionsReader(C13LinesSubstream.StreamData);
if (auto EC = SubsectionsReader.readArray(Subsections,
SubsectionsReader.bytesRemaining()))
return EC;
@@ -63,7 +67,7 @@ Error ModuleDebugStreamRef::reload() {
uint32_t GlobalRefsSize;
if (auto EC = Reader.readInteger(GlobalRefsSize))
return EC;
- if (auto EC = Reader.readStreamRef(GlobalRefsSubstream, GlobalRefsSize))
+ if (auto EC = Reader.readSubstream(GlobalRefsSubstream, GlobalRefsSize))
return EC;
if (Reader.bytesRemaining() > 0)
return make_error<RawError>(raw_error_code::corrupt_file,
@@ -72,9 +76,25 @@ Error ModuleDebugStreamRef::reload() {
return Error::success();
}
+BinarySubstreamRef ModuleDebugStreamRef::getSymbolsSubstream() const {
+ return SymbolsSubstream;
+}
+
+BinarySubstreamRef ModuleDebugStreamRef::getC11LinesSubstream() const {
+ return C11LinesSubstream;
+}
+
+BinarySubstreamRef ModuleDebugStreamRef::getC13LinesSubstream() const {
+ return C13LinesSubstream;
+}
+
+BinarySubstreamRef ModuleDebugStreamRef::getGlobalRefsSubstream() const {
+ return GlobalRefsSubstream;
+}
+
iterator_range<codeview::CVSymbolArray::Iterator>
ModuleDebugStreamRef::symbols(bool *HadError) const {
- return make_range(SymbolsSubstream.begin(HadError), SymbolsSubstream.end());
+ return make_range(SymbolArray.begin(HadError), SymbolArray.end());
}
llvm::iterator_range<ModuleDebugStreamRef::DebugSubsectionIterator>
@@ -83,7 +103,7 @@ ModuleDebugStreamRef::subsections() const {
}
bool ModuleDebugStreamRef::hasDebugSubsections() const {
- return C13LinesSubstream.getLength() > 0;
+ return !C13LinesSubstream.empty();
}
Error ModuleDebugStreamRef::commit() { return Error::success(); }
OpenPOWER on IntegriCloud