mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
test_gen: create a debug flag to print wasm interpreter log
This commit is contained in:
parent
6cc270241e
commit
b80278fe48
2 changed files with 5 additions and 2 deletions
|
@ -153,6 +153,9 @@ flags! {
|
||||||
/// Writes a `final.wasm` file to /tmp
|
/// Writes a `final.wasm` file to /tmp
|
||||||
ROC_WRITE_FINAL_WASM
|
ROC_WRITE_FINAL_WASM
|
||||||
|
|
||||||
|
/// Prints Wasm interpreter debug log in test_gen
|
||||||
|
ROC_LOG_WASM_INTERP
|
||||||
|
|
||||||
// ===Load===
|
// ===Load===
|
||||||
|
|
||||||
/// Print load phases as they complete.
|
/// Print load phases as they complete.
|
||||||
|
|
|
@ -239,7 +239,7 @@ where
|
||||||
let dispatcher = TestDispatcher {
|
let dispatcher = TestDispatcher {
|
||||||
wasi: wasi::WasiDispatcher { args: &[] },
|
wasi: wasi::WasiDispatcher { args: &[] },
|
||||||
};
|
};
|
||||||
let is_debug_mode = false;
|
let is_debug_mode = roc_debug_flags::dbg_set!(roc_debug_flags::ROC_LOG_WASM_INTERP);
|
||||||
let mut inst = Instance::for_module(&arena, &module, dispatcher, is_debug_mode)?;
|
let mut inst = Instance::for_module(&arena, &module, dispatcher, is_debug_mode)?;
|
||||||
let opt_value = inst.call_export(module, test_wrapper_name, [])?;
|
let opt_value = inst.call_export(module, test_wrapper_name, [])?;
|
||||||
let addr_value = opt_value.ok_or("No return address from Wasm test")?;
|
let addr_value = opt_value.ok_or("No return address from Wasm test")?;
|
||||||
|
@ -268,7 +268,7 @@ where
|
||||||
let dispatcher = TestDispatcher {
|
let dispatcher = TestDispatcher {
|
||||||
wasi: wasi::WasiDispatcher { args: &[] },
|
wasi: wasi::WasiDispatcher { args: &[] },
|
||||||
};
|
};
|
||||||
let is_debug_mode = false;
|
let is_debug_mode = roc_debug_flags::dbg_set!(roc_debug_flags::ROC_LOG_WASM_INTERP);
|
||||||
let mut inst = Instance::for_module(&arena, &module, dispatcher, is_debug_mode)?;
|
let mut inst = Instance::for_module(&arena, &module, dispatcher, is_debug_mode)?;
|
||||||
|
|
||||||
// Allocate a vector in the test host that refcounts will be copied into
|
// Allocate a vector in the test host that refcounts will be copied into
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue