adds coverage plugin
This commit is contained in:
32
src/plugin/cov.cpp
Normal file
32
src/plugin/cov.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <iss/plugin/cov.h>
|
||||
#include <iss/arch_if.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
iss::plugin::cov::cov() {
|
||||
std::cout << "Entering Constructor"<<std::endl;
|
||||
output.open("output.txt");
|
||||
|
||||
}
|
||||
|
||||
iss::plugin::cov::~cov() {
|
||||
std::cout << "Entering Destructor"<<std::endl;
|
||||
output.close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool iss::plugin::cov::registration(const char *const version, vm_if& vm) {
|
||||
instr_if = vm.get_arch()->get_instrumentation_if();
|
||||
return true;
|
||||
}
|
||||
void iss::plugin::cov::callback(instr_info_t iinfo, const exec_info&) {
|
||||
// if((instr_if->get_next_pc() - instr_if->get_pc() != 4) ||( instr_if->get_next_pc() - instr_if->get_pc() != 2)){
|
||||
// std::cout << "jump from " << std::hex << instr_if->get_pc() << " to " << instr_if->get_next_pc()<< " after " << std::dec << counter <<" linear instructions" <<std::endl;
|
||||
// counter = 0;
|
||||
// }else {
|
||||
// counter++;
|
||||
// }
|
||||
|
||||
output<<std::hex << instr_if->get_pc() << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user