DIASession.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //===- DIASession.h - DIA implementation of IPDBSession ---------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
  10. #define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
  11. #include "DIASupport.h"
  12. #include "llvm/ADT/StringRef.h"
  13. #include "llvm/DebugInfo/PDB/IPDBSession.h"
  14. namespace llvm {
  15. class DIASession : public IPDBSession {
  16. public:
  17. explicit DIASession(CComPtr<IDiaSession> DiaSession);
  18. static PDB_ErrorCode createFromPdb(StringRef Path,
  19. std::unique_ptr<IPDBSession> &Session);
  20. static PDB_ErrorCode createFromExe(StringRef Path,
  21. std::unique_ptr<IPDBSession> &Session);
  22. uint64_t getLoadAddress() const override;
  23. void setLoadAddress(uint64_t Address) override;
  24. std::unique_ptr<PDBSymbolExe> getGlobalScope() const override;
  25. std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
  26. std::unique_ptr<PDBSymbol>
  27. findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override;
  28. std::unique_ptr<IPDBEnumLineNumbers>
  29. findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
  30. std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
  31. std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
  32. const PDBSymbolCompiland &Compiland) const override;
  33. std::unique_ptr<IPDBSourceFile>
  34. getSourceFileById(uint32_t FileId) const override;
  35. std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;
  36. private:
  37. CComPtr<IDiaSession> Session;
  38. };
  39. }
  40. #endif