#pragma once // // This file is distributed under the MIT License. See LICENSE.md for details. // #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" #include "llvm/DebugInfo/PDB/Native/InputFile.h" #include "llvm/DebugInfo/PDB/Native/NativeSession.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/PDB.h" #include "llvm/Object/Binary.h" #include "llvm/Object/COFF.h" #include "revng/Model/Binary.h" #include "revng/Model/Importer/Binary/BinaryImporterHelper.h" struct ImporterOptions; class PDBImporter : public BinaryImporterHelper { private: TupleTree &Model; MetaAddress ImageBase; llvm::pdb::PDBFile *ThePDBFile = nullptr; llvm::pdb::NativeSession *TheNativeSession = nullptr; std::unique_ptr Session; std::optional ExpectedGUID; public: PDBImporter(TupleTree &Model, MetaAddress ImageBase); TupleTree &getModel() { return Model; } MetaAddress &getBaseAddress() { return ImageBase; } llvm::pdb::PDBFile *getPDBFile() { return ThePDBFile; } void import(const llvm::object::COFFObjectFile &TheBinary, const ImporterOptions &Options); bool loadDataFromPDB(llvm::StringRef PDBFileName); std::optional getPDBFilePath(const llvm::object::COFFObjectFile &TheBinary); std::optional getCachedPDBFilePath(std::string PDBFileID, llvm::StringRef PDBFilePath); };