24 return make_error<RawError>(
26 "Encountered unsupported globals stream version.");
41 uint32_t NumBitmapEntries = BitmapSizeInBits / 8;
42 if (
auto EC = Reader.
readBytes(Bitmap, NumBitmapEntries))
45 "Could not read a bitmap."));
47 for (uint8_t
B : Bitmap)
51 if (
auto EC = Reader.
readArray(HashBuckets, NumBuckets))
54 "Hash buckets corrupted."));
63 "Stream does not contain a GSIHashHeader.");
66 return make_error<RawError>(
68 "GSIHashHeader signature (0xffffffff) not found.");
83 "Invalid HR array size.");
85 if (
auto EC = Reader.
readArray(HashRecords, NumHashRecords))
88 "Error reading hash records."));
static const unsigned IPHR_HASH
From https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.cpp.
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
static Error checkHashHdrVersion(const GSIHashHeader *HashHdr)
Error readGSIHashRecords(FixedStreamArray< PSHashRecord > &HashRecords, const GSIHashHeader *HashHdr, BinaryStreamReader &Reader)
Error readGSIHashBuckets(FixedStreamArray< support::ulittle32_t > &HashBuckets, const GSIHashHeader *HashHdr, BinaryStreamReader &Reader)
static ErrorSuccess success()
Create a success value.
unsigned countPopulation(T Value)
Count the number of set bits in a value.
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Read Size bytes from the underlying stream at the current offset and and set Buffer to the resulting ...
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
Error readGSIHashHeader(const GSIHashHeader *&HashHdr, BinaryStreamReader &Reader)
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...