Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/iss/instrumentation_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ struct instrumentation_if {
* @return unordered map containing symbol name as key
*/
virtual std::unordered_map<std::string, uint64_t> const& get_symbol_table(std::string name) = 0;
/**
* get the core id
*
* @return core id
*/
virtual unsigned get_core_id() = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to have a default implementation returning 0?

};
} // namespace v2
} /* namespace iss */
Expand Down
4 changes: 4 additions & 0 deletions src/iss/interp/vm_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
}
int start(uint64_t count = std::numeric_limits<uint64_t>::max(), bool dump = false,
finish_cond_e cond = finish_cond_e::ICOUNT_LIMIT | finish_cond_e::JUMP_TO_SELF) override {
for(const auto& plugin_entry : plugins)
plugin_entry.plugin.execution_start_callback();
int error = 0;
auto start = std::chrono::high_resolution_clock::now();
virt_addr_t pc(iss::access_type::FETCH, arch::traits<ARCH>::MEM, get_reg<addr_t>(arch::traits<ARCH>::PC));
Expand Down Expand Up @@ -190,6 +192,7 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
if(sync & POST_SYNC)
post_plugins.push_back(plugin_entry{plugin});
sync_exec |= sync;
plugins.push_back({plugin});
}
}

Expand Down Expand Up @@ -238,6 +241,7 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
// non-owning pointers
// std::vector<Value *> loaded_regs{arch::traits<ARCH>::NUM_REGS, nullptr};
iss::debugger::target_adapter_base* tgt_adapter{nullptr};
std::vector<plugin_entry> plugins;
std::vector<plugin_entry> pre_plugins;
std::vector<plugin_entry> post_plugins;
std::vector<plugin_entry> illegal_cb_plugins;
Expand Down
2 changes: 2 additions & 0 deletions src/iss/vm_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class vm_plugin { // @suppress("Class has a virtual method and non-virtual destr
virtual sync_type get_sync() = 0;

virtual void callback(instr_info_t) = 0;

virtual void execution_start_callback(){};
};
} // namespace iss

Expand Down