SymbolizableModule.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- SymbolizableModule.h -------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file declares the SymbolizableModule interface.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
  18. #define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
  19. #include "llvm/DebugInfo/DIContext.h"
  20. #include <cstdint>
  21. namespace llvm {
  22. namespace symbolize {
  23. using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
  24. class SymbolizableModule {
  25. public:
  26. virtual ~SymbolizableModule() = default;
  27. virtual DILineInfo symbolizeCode(object::SectionedAddress ModuleOffset,
  28. DILineInfoSpecifier LineInfoSpecifier,
  29. bool UseSymbolTable) const = 0;
  30. virtual DIInliningInfo
  31. symbolizeInlinedCode(object::SectionedAddress ModuleOffset,
  32. DILineInfoSpecifier LineInfoSpecifier,
  33. bool UseSymbolTable) const = 0;
  34. virtual DIGlobal
  35. symbolizeData(object::SectionedAddress ModuleOffset) const = 0;
  36. virtual std::vector<DILocal>
  37. symbolizeFrame(object::SectionedAddress ModuleOffset) const = 0;
  38. // Return true if this is a 32-bit x86 PE COFF module.
  39. virtual bool isWin32Module() const = 0;
  40. // Returns the preferred base of the module, i.e. where the loader would place
  41. // it in memory assuming there were no conflicts.
  42. virtual uint64_t getModulePreferredBase() const = 0;
  43. };
  44. } // end namespace symbolize
  45. } // end namespace llvm
  46. #endif // LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
  47. #ifdef __GNUC__
  48. #pragma GCC diagnostic pop
  49. #endif