diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 | 
| commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
| tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /lib/DebugInfo/PDB/Native/PublicsStream.cpp | |
| parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) | |
Notes
Diffstat (limited to 'lib/DebugInfo/PDB/Native/PublicsStream.cpp')
| -rw-r--r-- | lib/DebugInfo/PDB/Native/PublicsStream.cpp | 52 | 
1 files changed, 12 insertions, 40 deletions
| diff --git a/lib/DebugInfo/PDB/Native/PublicsStream.cpp b/lib/DebugInfo/PDB/Native/PublicsStream.cpp index 9c3e654f808b..f6466eb80464 100644 --- a/lib/DebugInfo/PDB/Native/PublicsStream.cpp +++ b/lib/DebugInfo/PDB/Native/PublicsStream.cpp @@ -23,13 +23,10 @@  //===----------------------------------------------------------------------===//  #include "llvm/DebugInfo/PDB/Native/PublicsStream.h" -#include "GSI.h"  #include "llvm/ADT/iterator_range.h"  #include "llvm/DebugInfo/CodeView/SymbolRecord.h"  #include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/PDB/Native/PDBFile.h"  #include "llvm/DebugInfo/PDB/Native/RawError.h" -#include "llvm/DebugInfo/PDB/Native/SymbolStream.h"  #include "llvm/Support/BinaryStreamReader.h"  #include "llvm/Support/Endian.h"  #include "llvm/Support/Error.h" @@ -41,14 +38,18 @@ using namespace llvm::msf;  using namespace llvm::support;  using namespace llvm::pdb; -PublicsStream::PublicsStream(PDBFile &File, -                             std::unique_ptr<MappedBlockStream> Stream) -    : Pdb(File), Stream(std::move(Stream)) {} +PublicsStream::PublicsStream(std::unique_ptr<MappedBlockStream> Stream) +    : Stream(std::move(Stream)) {}  PublicsStream::~PublicsStream() = default;  uint32_t PublicsStream::getSymHash() const { return Header->SymHash; } -uint32_t PublicsStream::getAddrMap() const { return Header->AddrMap; } +uint16_t PublicsStream::getThunkTableSection() const { +  return Header->ISectThunkTable; +} +uint32_t PublicsStream::getThunkTableOffset() const { +  return Header->OffThunkTable; +}  // Publics stream contains fixed-size headers and a serialized hash table.  // This implementation is not complete yet. It reads till the end of the @@ -64,20 +65,14 @@ Error PublicsStream::reload() {      return make_error<RawError>(raw_error_code::corrupt_file,                                  "Publics Stream does not contain a header."); -  // Read PSGSIHDR and GSIHashHdr structs. +  // Read PSGSIHDR struct.    if (Reader.readObject(Header))      return make_error<RawError>(raw_error_code::corrupt_file,                                  "Publics Stream does not contain a header."); -  if (auto EC = readGSIHashHeader(HashHdr, Reader)) -    return EC; - -  if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader)) -    return EC; - -  if (auto EC = readGSIHashBuckets(HashBuckets, HashHdr, Reader)) -    return EC; -  NumBuckets = HashBuckets.size(); +  // Read the hash table. +  if (auto E = PublicsTable.read(Reader)) +    return E;    // Something called "address map" follows.    uint32_t NumAddressMapEntries = Header->AddrMap / sizeof(uint32_t); @@ -105,26 +100,3 @@ Error PublicsStream::reload() {                                  "Corrupted publics stream.");    return Error::success();  } - -iterator_range<codeview::CVSymbolArray::Iterator> -PublicsStream::getSymbols(bool *HadError) const { -  auto SymbolS = Pdb.getPDBSymbolStream(); -  if (SymbolS.takeError()) { -    codeview::CVSymbolArray::Iterator Iter; -    return make_range(Iter, Iter); -  } -  SymbolStream &SS = SymbolS.get(); - -  return SS.getSymbols(HadError); -} - -Expected<const codeview::CVSymbolArray &> -PublicsStream::getSymbolArray() const { -  auto SymbolS = Pdb.getPDBSymbolStream(); -  if (!SymbolS) -    return SymbolS.takeError(); - -  return SymbolS->getSymbolArray(); -} - -Error PublicsStream::commit() { return Error::success(); } | 
