LibWasm: Add execution hooks and a debugger mode to the wasm tool

This is useful for debugging *our* implementation of wasm :P
This commit is contained in:
Ali Mohammad Pur 2021-05-21 21:10:44 +04:30 committed by Ali Mohammad Pur
commit ba5da79617
Notes: sideshowbarker 2024-07-18 17:22:42 +09:00
8 changed files with 299 additions and 4 deletions

View file

@ -16,6 +16,7 @@
namespace Wasm {
class Configuration;
struct Interpreter;
struct InstantiationError {
String error { "Unknown error" };
@ -445,6 +446,9 @@ public:
auto& store() const { return m_store; }
auto& store() { return m_store; }
Function<bool(Configuration&, InstructionPointer&, const Instruction&)> pre_interpret_hook;
Function<bool(Configuration&, InstructionPointer&, const Instruction&, const Interpreter&)> post_interpret_hook;
private:
Optional<InstantiationError> allocate_all(const Module&, ModuleInstance&, Vector<ExternValue>&, Vector<Value>& global_values);
Store m_store;