ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Classes | Public Member Functions | Private Attributes | List of all members
etiss::plugin::InstructionSpecificAddressCallback Class Referenceabstract

a simple plugin that prints the instruction and address when an instruction is executed More...

#include <InstructionSpecificAddressCallback.h>

Inheritance diagram for etiss::plugin::InstructionSpecificAddressCallback:
Inheritance graph
[legend]
Collaboration diagram for etiss::plugin::InstructionSpecificAddressCallback:
Collaboration graph
[legend]

Classes

struct  Data
 

Public Member Functions

 InstructionSpecificAddressCallback ()
 
 ~InstructionSpecificAddressCallback ()
 
virtual bool callback ()=0
 implement this callback to manipulate the cpu be fore executing the defined instructions at the defined address More...
 
virtual bool callbackOnInstruction (etiss::instr::Instruction &instr) const
 implement to return true to call InstructionSpecificAddressCallback::callback whenever that etiss::instr::Instruction is executed. More...
 
virtual void addCallbackAddress (uint64_t addr)
 call to add an address at which callback should be called upon execution. More...
 
virtual void removeCallbackAddress (uint64_t addr)
 
const std::set< uint64_t > & callbackAddresses () const
 
virtual void finalizeInstrSet (etiss::instr::ModedInstructionSet &) const
 called after all instructions have been added to allow last changes More...
 
virtual void initCodeBlock (etiss::CodeBlock &block) const
 called before instructions are translated for the code block More...
 
virtual std::string _getPluginName () const
 
virtual void * getPluginHandle ()
 called to get the handle that is available in translated code via getPoinerCode(). [default: this] More...
 
- Public Member Functions inherited from etiss::TranslationPlugin
 TranslationPlugin ()
 
virtual ~TranslationPlugin ()
 
virtual void initInstrSet (etiss::instr::ModedInstructionSet &) const
 called to add instructions to the instruction set More...
 
virtual void finalizeCodeBlock (etiss::CodeBlock &) const
 called after all instructions have been translated for the code block More...
 
- Public Member Functions inherited from etiss::Plugin
virtual ~Plugin ()
 
unsigned getType ()
 
InterruptListenerPlugingetInterruptListenerPlugin ()
 
CoroutinePlugingetCoroutinePlugin ()
 
SystemWrapperPlugingetSystemWrapperPlugin ()
 
RegisterDevicePlugingetRegisterDevicePlugin ()
 
TranslationPlugingetTranslationPlugin ()
 
std::string getPluginName () const
 
const std::string & getLastAssignedCoreName ()
 
std::string toString () const
 
- Public Member Functions inherited from etiss::ToString
 ToString ()
 
virtual ~ToString ()
 

Private Attributes

Data pluginData_
 
std::set< uint64_tcaddrset_
 

Additional Inherited Members

- Static Public Attributes inherited from etiss::Plugin
static const unsigned INTERRUPTLISTENER = 1 << 0
 access to translated code More...
 
static const unsigned COROUTINE = 1 << 1
 callback after execution of each translated block More...
 
static const unsigned SYSTEMWRAPPER = 1 << 2
 can wrap/change ETISS_System structure at execution start More...
 
static const unsigned REGISTERDEVICE
 gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) More...
 
static const unsigned TRANSLATION
 access to translated code during translation phase or when instruction tree is built More...
 
- Protected Member Functions inherited from etiss::TranslationPlugin
std::string getPointerCode () const
 returns a C code expression that allows to get or assign a pointer to the variable assigned to this translation plugin. More...
 
- Protected Member Functions inherited from etiss::Plugin
 Plugin (unsigned type=0)
 
virtual void init (ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch)
 this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute). More...
 
virtual void cleanup ()
 this function is called after cpu execution loop (etiss::CPUCore::execute) finished. More...
 
void setCorrespondingCPUCoreName (std::string name)
 
virtual void addedToCPUCore (etiss::CPUCore *core)
 called as soon a plugin has been added to its CPUCore. More...
 
virtual void removedFromCPUCore (etiss::CPUCore *core)
 called as soon a plugin has been removed from its CPUCore. More...
 
- Protected Attributes inherited from etiss::Plugin
ETISS_CPUplugin_cpu_
 holds a pointer to the cpu structure. will be set before init call and after cleanup call More...
 
ETISS_Systemplugin_system_
 holds a pointer to the system structure. More...
 
CPUArchplugin_arch_
 holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More...
 
CPUCoreplugin_core_
 holds a pointer to the associated CPUCore instance. More...
 

Detailed Description

a simple plugin that prints the instruction and address when an instruction is executed

Definition at line 67 of file InstructionSpecificAddressCallback.h.

Constructor & Destructor Documentation

◆ InstructionSpecificAddressCallback()

InstructionSpecificAddressCallback::InstructionSpecificAddressCallback ( )

◆ ~InstructionSpecificAddressCallback()

InstructionSpecificAddressCallback::~InstructionSpecificAddressCallback ( )

Definition at line 83 of file InstructionSpecificAddressCallback.cpp.

Member Function Documentation

◆ _getPluginName()

std::string InstructionSpecificAddressCallback::_getPluginName ( ) const
virtual

Implements etiss::Plugin.

Definition at line 143 of file InstructionSpecificAddressCallback.cpp.

◆ addCallbackAddress()

virtual void etiss::plugin::InstructionSpecificAddressCallback::addCallbackAddress ( uint64_t  addr)
inlinevirtual

call to add an address at which callback should be called upon execution.

May be changed during execution.please not that only aligned addresses will have an effect.

Definition at line 93 of file InstructionSpecificAddressCallback.h.

References caddrset_, pluginData_, and etiss::plugin::InstructionSpecificAddressCallback::Data::state_.

◆ callback()

virtual bool etiss::plugin::InstructionSpecificAddressCallback::callback ( )
pure virtual

implement this callback to manipulate the cpu be fore executing the defined instructions at the defined address

◆ callbackAddresses()

const std::set<uint64_t>& etiss::plugin::InstructionSpecificAddressCallback::callbackAddresses ( ) const
inline

Definition at line 104 of file InstructionSpecificAddressCallback.h.

References caddrset_.

Referenced by finalizeInstrSet().

Here is the caller graph for this function:

◆ callbackOnInstruction()

virtual bool etiss::plugin::InstructionSpecificAddressCallback::callbackOnInstruction ( etiss::instr::Instruction instr) const
inlinevirtual

implement to return true to call InstructionSpecificAddressCallback::callback whenever that etiss::instr::Instruction is executed.

used by finalizeInstrSet

Definition at line 89 of file InstructionSpecificAddressCallback.h.

Referenced by finalizeInstrSet().

Here is the caller graph for this function:

◆ finalizeInstrSet()

void InstructionSpecificAddressCallback::finalizeInstrSet ( etiss::instr::ModedInstructionSet ) const
virtual

◆ getPluginHandle()

void * InstructionSpecificAddressCallback::getPluginHandle ( )
virtual

called to get the handle that is available in translated code via getPoinerCode(). [default: this]

Reimplemented from etiss::TranslationPlugin.

Definition at line 148 of file InstructionSpecificAddressCallback.cpp.

References pluginData_.

◆ initCodeBlock()

void InstructionSpecificAddressCallback::initCodeBlock ( etiss::CodeBlock ) const
virtual

called before instructions are translated for the code block

Reimplemented from etiss::TranslationPlugin.

Definition at line 85 of file InstructionSpecificAddressCallback.cpp.

References etiss::CodeBlock::fileglobalCode(), etiss::CodeBlock::functionglobalCode(), etiss::TranslationPlugin::getPointerCode(), pluginData_, etiss::plugin::InstructionSpecificAddressCallback::Data::state_, and etiss::toString().

Here is the call graph for this function:

◆ removeCallbackAddress()

virtual void etiss::plugin::InstructionSpecificAddressCallback::removeCallbackAddress ( uint64_t  addr)
inlinevirtual

Member Data Documentation

◆ caddrset_

std::set<uint64_t> etiss::plugin::InstructionSpecificAddressCallback::caddrset_
private

◆ pluginData_

Data etiss::plugin::InstructionSpecificAddressCallback::pluginData_
private

The documentation for this class was generated from the following files: