forked from OSchip/llvm-project
PDB - Instead of hardcoding stream numbers, use an enum.
llvm-svn: 268270
This commit is contained in:
parent
6edb891c8e
commit
b56d904433
|
@ -34,6 +34,13 @@ enum PdbRaw_DbiVer : uint32_t {
|
|||
PdbDbiV70 = 19990903,
|
||||
PdbDbiV110 = 20091201
|
||||
};
|
||||
|
||||
enum SpecialStream : uint32_t {
|
||||
StreamPDB = 1,
|
||||
StreamTPI = 2,
|
||||
StreamDBI = 3,
|
||||
StreamIPI = 4,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ struct DbiStream::HeaderInfo {
|
|||
ulittle32_t Reserved; // Pad to 64 bytes
|
||||
};
|
||||
|
||||
DbiStream::DbiStream(PDBFile &File) : Pdb(File), Stream(3, File) {
|
||||
DbiStream::DbiStream(PDBFile &File) : Pdb(File), Stream(StreamDBI, File) {
|
||||
static_assert(sizeof(HeaderInfo) == 64, "Invalid HeaderInfo size!");
|
||||
}
|
||||
|
||||
|
|
|
@ -10,30 +10,35 @@
|
|||
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/StreamReader.h"
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
InfoStream::InfoStream(PDBFile &File) : Pdb(File), Stream(1, File) {}
|
||||
InfoStream::InfoStream(PDBFile &File) : Pdb(File), Stream(StreamPDB, File) {}
|
||||
|
||||
std::error_code InfoStream::reload() {
|
||||
StreamReader Reader(Stream);
|
||||
|
||||
support::ulittle32_t Value;
|
||||
struct Header {
|
||||
support::ulittle32_t Version;
|
||||
support::ulittle32_t Signature;
|
||||
support::ulittle32_t Age;
|
||||
PDB_UniqueId Guid;
|
||||
};
|
||||
|
||||
Reader.readObject(&Value);
|
||||
Version = Value;
|
||||
if (Version < PdbRaw_ImplVer::PdbImplVC70)
|
||||
Header H;
|
||||
Reader.readObject(&H);
|
||||
|
||||
if (H.Version < PdbRaw_ImplVer::PdbImplVC70)
|
||||
return std::make_error_code(std::errc::not_supported);
|
||||
|
||||
Reader.readObject(&Value);
|
||||
Signature = Value;
|
||||
Version = H.Version;
|
||||
Signature = H.Signature;
|
||||
Age = H.Age;
|
||||
Guid = H.Guid;
|
||||
|
||||
Reader.readObject(&Value);
|
||||
Age = Value;
|
||||
|
||||
Reader.readObject(&Guid);
|
||||
NamedStreams.load(Reader);
|
||||
|
||||
return std::error_code();
|
||||
|
|
Loading…
Reference in New Issue