mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
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:
parent
f740667fa1
commit
ba5da79617
8 changed files with 299 additions and 4 deletions
|
@ -113,6 +113,8 @@ InstantiationResult AbstractMachine::instantiate(const Module& module, Vector<Ex
|
|||
entry.expression(),
|
||||
1);
|
||||
Configuration config { m_store };
|
||||
config.pre_interpret_hook = &pre_interpret_hook;
|
||||
config.post_interpret_hook = &post_interpret_hook;
|
||||
config.set_frame(move(frame));
|
||||
auto result = config.execute();
|
||||
// What if this traps?
|
||||
|
@ -143,6 +145,8 @@ InstantiationResult AbstractMachine::instantiate(const Module& module, Vector<Ex
|
|||
data.offset,
|
||||
1);
|
||||
Configuration config { m_store };
|
||||
config.pre_interpret_hook = &pre_interpret_hook;
|
||||
config.post_interpret_hook = &post_interpret_hook;
|
||||
config.set_frame(move(frame));
|
||||
auto result = config.execute();
|
||||
size_t offset = 0;
|
||||
|
@ -281,7 +285,10 @@ Optional<InstantiationError> AbstractMachine::allocate_all(const Module& module,
|
|||
|
||||
Result AbstractMachine::invoke(FunctionAddress address, Vector<Value> arguments)
|
||||
{
|
||||
return Configuration { m_store }.call(address, move(arguments));
|
||||
Configuration configuration { m_store };
|
||||
configuration.pre_interpret_hook = &pre_interpret_hook;
|
||||
configuration.post_interpret_hook = &post_interpret_hook;
|
||||
return configuration.call(address, move(arguments));
|
||||
}
|
||||
|
||||
void Linker::link(const ModuleInstance& instance)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue