ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
InstructionSpecificAddressCallback.h
Go to the documentation of this file.
1 
52 #ifndef ETISS_PLUGIN_InstructionSpecificAddressCallback_H_
53 #define ETISS_PLUGIN_InstructionSpecificAddressCallback_H_
54 
55 #include "etiss/Instruction.h"
56 #include "etiss/Plugin.h"
57 
58 namespace etiss
59 {
60 
61 namespace plugin
62 {
63 
68 {
69  public:
70  struct Data
71  {
72  uint32_t state_; // must be first field to allow pointer cast to uint32_t* for direct acess; the state is
73  // increased whenever a change is made
74  void *this_;
75  };
76 
77  private:
79  std::set<uint64_t> caddrset_;
80 
81  public:
85  virtual bool callback() = 0; // return values indicates if the block should be stopt with execution
86 
89  inline virtual bool callbackOnInstruction(etiss::instr::Instruction &instr) const { return false; }
90 
93  inline virtual void addCallbackAddress(uint64_t addr)
94  {
95  caddrset_.insert(addr);
96  pluginData_.state_++; // Force Rewriting of Code Block
97  }
98  inline virtual void removeCallbackAddress(uint64_t addr)
99  {
100  caddrset_.erase(addr);
101  pluginData_.state_++; // Force Rewriting of Code Block
102  }
103 
104  inline const std::set<uint64_t> &callbackAddresses() const { return caddrset_; }
105 
107  virtual void initCodeBlock(etiss::CodeBlock &block) const;
108  virtual std::string _getPluginName() const;
109  virtual void *getPluginHandle();
110 };
111 
112 } // namespace plugin
113 
114 } // namespace etiss
115 
116 #endif
contains container classes to store instruction definitions + translation functions and build a trans...
plugins for extensions to code translation and instruction execution
static __inline__ uint32_t
Definition: arm_cde.h:25
static __inline__ uint64_t
Definition: arm_cde.h:31
A list of CodeSets.
Definition: CodePart.h:570
allows to add code to the translation of instructions
Definition: Plugin.h:262
holds information and translation callbacks for an instruction.
Definition: Instruction.h:393
holds etiss::instr::VariableInstructionSet instances for different modes.
Definition: Instruction.h:562
a simple plugin that prints the instruction and address when an instruction is executed
virtual void addCallbackAddress(uint64_t addr)
call to add an address at which callback should be called upon execution.
virtual void initCodeBlock(etiss::CodeBlock &block) const
called before instructions are translated for the code block
virtual void finalizeInstrSet(etiss::instr::ModedInstructionSet &) const
called after all instructions have been added to allow last changes
virtual void * getPluginHandle()
called to get the handle that is available in translated code via getPoinerCode()....
virtual bool callback()=0
implement this callback to manipulate the cpu be fore executing the defined instructions at the defin...
virtual bool callbackOnInstruction(etiss::instr::Instruction &instr) const
implement to return true to call InstructionSpecificAddressCallback::callback whenever that etiss::in...
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53