LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObjectImage.h
Go to the documentation of this file.
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 
14 #ifndef LLVM_EXECUTIONENGINE_OBJECTIMAGE_H
15 #define LLVM_EXECUTIONENGINE_OBJECTIMAGE_H
16 
18 #include "llvm/Object/ObjectFile.h"
19 
20 namespace llvm {
21 
22 
23 /// ObjectImage - A container class that represents an ObjectFile that has been
24 /// or is in the process of being loaded into memory for execution.
25 class ObjectImage {
28  virtual void anchor();
29 
30 protected:
32 
33 public:
34  ObjectImage(ObjectBuffer *Input) : Buffer(Input) {}
35  virtual ~ObjectImage() {}
36 
37  virtual object::symbol_iterator begin_symbols() const = 0;
38  virtual object::symbol_iterator end_symbols() const = 0;
39 
40  virtual object::section_iterator begin_sections() const = 0;
41  virtual object::section_iterator end_sections() const = 0;
42 
43  virtual /* Triple::ArchType */ unsigned getArch() const = 0;
44 
45  // Subclasses can override these methods to update the image with loaded
46  // addresses for sections and common symbols
47  virtual void updateSectionAddress(const object::SectionRef &Sec,
48  uint64_t Addr) = 0;
49  virtual void updateSymbolAddress(const object::SymbolRef &Sym,
50  uint64_t Addr) = 0;
51 
52  virtual StringRef getData() const = 0;
53 
54  virtual object::ObjectFile* getObjectFile() const = 0;
55 
56  // Subclasses can override these methods to provide JIT debugging support
57  virtual void registerWithDebugger() = 0;
58  virtual void deregisterWithDebugger() = 0;
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_EXECUTIONENGINE_OBJECTIMAGE_H
64 
virtual ~ObjectImage()
Definition: ObjectImage.h:35
virtual void deregisterWithDebugger()=0
OwningPtr< ObjectBuffer > Buffer
Definition: ObjectImage.h:31
virtual void updateSymbolAddress(const object::SymbolRef &Sym, uint64_t Addr)=0
virtual unsigned getArch() const =0
virtual object::symbol_iterator end_symbols() const =0
virtual object::symbol_iterator begin_symbols() const =0
virtual StringRef getData() const =0
ObjectImage(ObjectBuffer *Input)
Definition: ObjectImage.h:34
virtual void updateSectionAddress(const object::SectionRef &Sec, uint64_t Addr)=0
#define LLVM_DELETED_FUNCTION
Definition: Compiler.h:137
virtual object::ObjectFile * getObjectFile() const =0
virtual void registerWithDebugger()=0
virtual object::section_iterator end_sections() const =0
virtual object::section_iterator begin_sections() const =0