65 const std::string &field,
const std::string &file,
66 std::function<
void(std::ostream &out,
const std::string &field,
uint64_t value)>
writer)
70 writer = [](std::ostream &out,
const std::string &field,
uint64_t value) {
71 out << field <<
"," << value <<
"\n";
73 out_.open(file.c_str(), std::ios::binary);
79 block.
fileglobalCode().insert(
"extern void etiss_plugin_VariableValueLogger(void *); ");
85 unsigned width = f ?
static_cast<unsigned>(f->width_) : 64;
104 if (
field_ ==
"instructionPointer")
117 return std::string(
"VariableValueLogger for ") +
field_;
defines main cpu core interface
contains container classes to store instruction definitions + translation functions and build a trans...
void etiss_plugin_VariableValueLogger(void *ptr)
static __inline__ uint64_t
virtual std::shared_ptr< VirtualStruct > getStruct()
Get the virtual structure of this CPUCore instance.
std::set< std::string > & fileglobalCode()
Contains a small code snipped.
RegisterSet & getRegisterDependencies()
void append(const CodePart &part, CodePart::TYPE type)
CPUCore * plugin_core_
holds a pointer to the associated CPUCore instance.
ETISS_CPU * plugin_cpu_
holds a pointer to the cpu structure. will be set before init call and after cleanup call
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...
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)
writes the value of a field before each instruction
std::ofstream out_
file stream for logger.
VariableValueLogger(const std::string &field, const std::string &file, std::function< void(std::ostream &out, const std::string &field, uint64_t value)> writer)
virtual std::string _getPluginName() const
returns the name of the Plugin.
virtual void initCodeBlock(etiss::CodeBlock &block) const
called before instructions are translated for the code block
void writeValue()
Calls the function specified with writer_ to log the variable.
std::function< void(std::ostream &out, const std::string &field, uint64_t value)> writer_
Function which specifies the outout format.
virtual void finalizeInstrSet(etiss::instr::ModedInstructionSet &) const
called after all instructions have been added to allow last changes
std::string field_
Name of the field to log.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
etiss_uint64 instructionPointer
pointer to next instruction.