1 //===- InfoStream.h - PDB Info Stream (Stream 1) Access ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H
13 #include "llvm/ADT/BitmaskEnum.h"
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/DebugInfo/CodeView/GUID.h"
16 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
17 #include "llvm/DebugInfo/PDB/Native/NamedStreamMap.h"
18 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
19 #include "llvm/DebugInfo/PDB/PDBTypes.h"
21 #include "llvm/Support/Endian.h"
22 #include "llvm/Support/Error.h"
26 class InfoStreamBuilder;
30 friend class InfoStreamBuilder;
33 InfoStream(std::unique_ptr<msf::MappedBlockStream> Stream);
37 uint32_t getStreamSize() const;
39 bool containsIdStream() const;
40 PdbRaw_ImplVer getVersion() const;
41 uint32_t getSignature() const;
42 uint32_t getAge() const;
43 codeview::GUID getGuid() const;
44 uint32_t getNamedStreamMapByteSize() const;
46 PdbRaw_Features getFeatures() const;
47 ArrayRef<PdbRaw_FeatureSig> getFeatureSignatures() const;
49 const NamedStreamMap &getNamedStreams() const;
51 BinarySubstreamRef getNamedStreamsBuffer() const;
53 uint32_t getNamedStreamIndex(llvm::StringRef Name) const;
54 iterator_range<StringMapConstIterator<uint32_t>> named_streams() const;
57 std::unique_ptr<msf::MappedBlockStream> Stream;
59 // PDB file format version. We only support VC70. See the enumeration
60 // `PdbRaw_ImplVer` for the other possible values.
63 // A 32-bit signature unique across all PDBs. This is generated with
64 // a call to time() when the PDB is written, but obviously this is not
65 // universally unique.
68 // The number of times the PDB has been written. Might also be used to
69 // ensure that the PDB matches the executable.
72 // Due to the aforementioned limitations with `Signature`, this is a new
73 // signature present on VC70 and higher PDBs which is guaranteed to be
74 // universally unique.
77 BinarySubstreamRef SubNamedStreams;
79 std::vector<PdbRaw_FeatureSig> FeatureSignatures;
80 PdbRaw_Features Features = PdbFeatureNone;
82 uint32_t NamedStreamMapByteSize = 0;
84 NamedStreamMap NamedStreams;