Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.0 KiB

  1. //===---- ObjectImage.h - Format independent executuable object image -----===//
  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. //
  10. // This file declares a file format independent ObjectImage class.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_EXECUTIONENGINE_OBJECTIMAGE_H
  14. #define LLVM_EXECUTIONENGINE_OBJECTIMAGE_H
  15. #include "llvm/ExecutionEngine/ObjectBuffer.h"
  16. #include "llvm/Object/ObjectFile.h"
  17. namespace llvm {
  18. /// ObjectImage - A container class that represents an ObjectFile that has been
  19. /// or is in the process of being loaded into memory for execution.
  20. class ObjectImage {
  21. ObjectImage() LLVM_DELETED_FUNCTION;
  22. ObjectImage(const ObjectImage &other) LLVM_DELETED_FUNCTION;
  23. protected:
  24. OwningPtr<ObjectBuffer> Buffer;
  25. public:
  26. ObjectImage(ObjectBuffer *Input) : Buffer(Input) {}
  27. virtual ~ObjectImage() {}
  28. virtual object::symbol_iterator begin_symbols() const = 0;
  29. virtual object::symbol_iterator end_symbols() const = 0;
  30. virtual object::section_iterator begin_sections() const = 0;
  31. virtual object::section_iterator end_sections() const = 0;
  32. virtual /* Triple::ArchType */ unsigned getArch() const = 0;
  33. // Subclasses can override these methods to update the image with loaded
  34. // addresses for sections and common symbols
  35. virtual void updateSectionAddress(const object::SectionRef &Sec,
  36. uint64_t Addr) = 0;
  37. virtual void updateSymbolAddress(const object::SymbolRef &Sym,
  38. uint64_t Addr) = 0;
  39. virtual StringRef getData() const = 0;
  40. virtual object::ObjectFile* getObjectFile() const = 0;
  41. // Subclasses can override these methods to provide JIT debugging support
  42. virtual void registerWithDebugger() = 0;
  43. virtual void deregisterWithDebugger() = 0;
  44. };
  45. } // end namespace llvm
  46. #endif // LLVM_EXECUTIONENGINE_OBJECTIMAGE_H