diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-26 20:32:52 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-26 20:32:52 +0000 | 
| commit | 08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (patch) | |
| tree | 80108f0f128657f8623f8f66ad9735b4d88e7b47 /lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | |
| parent | 7c7aba6e5fef47a01a136be655b0a92cfd7090f6 (diff) | |
Notes
Diffstat (limited to 'lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp')
| -rw-r--r-- | lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | 36 | 
1 files changed, 28 insertions, 8 deletions
diff --git a/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp index 4186f2eb6ba01..83c56574a16e5 100644 --- a/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp +++ b/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(); }  | 
