DxilDiaDataSource.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilDiaDataSource.cpp //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // DIA API implementation for DXIL modules. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. #include "dxc/Support/WinIncludes.h"
  13. #include <memory>
  14. #include "dia2.h"
  15. #include "dxc/DXIL/DxilModule.h"
  16. #include "dxc/Support/Global.h"
  17. #include "DxilDia.h"
  18. #include "DxilDiaTable.h"
  19. namespace dxil_dia {
  20. class Session;
  21. class DataSource : public IDiaDataSource {
  22. private:
  23. DXC_MICROCOM_TM_REF_FIELDS()
  24. std::shared_ptr<llvm::Module> m_module;
  25. std::shared_ptr<llvm::LLVMContext> m_context;
  26. std::shared_ptr<llvm::DebugInfoFinder> m_finder;
  27. public:
  28. DXC_MICROCOM_TM_ADDREF_RELEASE_IMPL()
  29. STDMETHODIMP QueryInterface(REFIID iid, void **ppvObject) {
  30. return DoBasicQueryInterface<IDiaDataSource>(this, iid, ppvObject);
  31. }
  32. DataSource(IMalloc *pMalloc);
  33. ~DataSource();
  34. STDMETHODIMP get_lastError(BSTR *pRetVal) override;
  35. STDMETHODIMP loadDataFromPdb(_In_ LPCOLESTR pdbPath) override { return ENotImpl(); }
  36. STDMETHODIMP loadAndValidateDataFromPdb(
  37. _In_ LPCOLESTR pdbPath,
  38. _In_ GUID *pcsig70,
  39. _In_ DWORD sig,
  40. _In_ DWORD age) override { return ENotImpl(); }
  41. STDMETHODIMP loadDataForExe(
  42. _In_ LPCOLESTR executable,
  43. _In_ LPCOLESTR searchPath,
  44. _In_ IUnknown *pCallback) override { return ENotImpl(); }
  45. STDMETHODIMP loadDataFromIStream(_In_ IStream *pIStream) override;
  46. STDMETHODIMP openSession(_COM_Outptr_ IDiaSession **ppSession) override;
  47. HRESULT STDMETHODCALLTYPE loadDataFromCodeViewInfo(
  48. _In_ LPCOLESTR executable,
  49. _In_ LPCOLESTR searchPath,
  50. _In_ DWORD cbCvInfo,
  51. _In_ BYTE *pbCvInfo,
  52. _In_ IUnknown *pCallback) override { return ENotImpl(); }
  53. HRESULT STDMETHODCALLTYPE loadDataFromMiscInfo(
  54. _In_ LPCOLESTR executable,
  55. _In_ LPCOLESTR searchPath,
  56. _In_ DWORD timeStampExe,
  57. _In_ DWORD timeStampDbg,
  58. _In_ DWORD sizeOfExe,
  59. _In_ DWORD cbMiscInfo,
  60. _In_ BYTE *pbMiscInfo,
  61. _In_ IUnknown *pCallback) override { return ENotImpl(); }
  62. };
  63. } // namespace dxil_dia