67 if (data_->
this_ == 0)
87 block.
fileglobalCode().insert(
"extern int InstructionSpecificAddressCallback_callback(void *);\n");
90 ") return ETISS_RETURNCODE_RELOADCURRENTBLOCK;\n");
102 std::stringstream ss;
103 ss <<
" if ( (*(uint32_t*)(" << getPointerCode()
104 <<
")) != " << etiss::toString(pluginData_.state_) <<
")\n"
105 <<
" return ETISS_RETURNCODE_RELOADCURRENTBLOCK;";
106 cs.append(CodePart::PREINITIALDEBUGRETURNING).code() = ss.str();
110 ss <<
" uint32_t callbackCalled = InstructionSpecificAddressCallback_callback("
111 << getPointerCode() <<
");";
113 cs.append(CodePart::PREINITIALDEBUGRETURNING).code() = ss.str();
117 ss <<
" if(callbackCalled)\n"
118 <<
" return ETISS_RETURNCODE_NOERROR;";
120 cs.append(CodePart::PREINITIALDEBUGRETURNING).code() = ss.str();
129 std::stringstream ss;
130 ss <<
" InstructionSpecificAddressCallback_callback(";
145 return "InstructionSpecificAddressCallback";
int InstructionSpecificAddressCallback_callback(void *this_)
contains a simple plugin to print instructions
std::set< std::string > & functionglobalCode()
std::set< std::string > & fileglobalCode()
@ PREINITIALDEBUGRETURNING
void append(const CodePart &part, CodePart::TYPE type)
std::string getPointerCode() const
returns a C code expression that allows to get or assign a pointer to the variable assigned to this t...
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds etiss::instr::Instruction instances and handles automatic instruction tree creation.
void foreach(std::function< void(Instruction &)> func)
holds information and translation callbacks for an instruction.
bool addCallback(std::function< bool(BitArray &, etiss::CodeSet &, InstructionContext &)> callback, uint32_t builtinGroups, const std::set< uint32_t > &groups=std::set< uint32_t >())
holds etiss::instr::VariableInstructionSet instances for different modes.
void foreach(std::function< void(VariableInstructionSet &)> call)
holds etiss::instr::InstructionSet instances with different bit widths.
void foreach(std::function< void(InstructionSet &)> func)
a simple plugin that prints the instruction and address when an instruction is executed
InstructionSpecificAddressCallback()
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
const std::set< uint64_t > & callbackAddresses() const
~InstructionSpecificAddressCallback()
virtual void * getPluginHandle()
called to get the handle that is available in translated code via getPoinerCode()....
virtual std::string _getPluginName() const
virtual bool callbackOnInstruction(etiss::instr::Instruction &instr) const
implement to return true to call InstructionSpecificAddressCallback::callback whenever that etiss::in...
std::string toString(const T &val)
conversion of type T to std::string.
void log(Verbosity level, std::string msg)
write log message at the given level.