@@ -7,6 +7,7 @@ use clap::Parser;
77use context:: Context ;
88use std:: { path:: Path , process} ;
99use wasmi:: { Func , FuncType , Val } ;
10+ use wasmi_tracer:: WasmTracer ;
1011
1112mod args;
1213mod context;
@@ -20,7 +21,9 @@ fn main() -> Result<()> {
2021 let args = Args :: parse ( ) ;
2122 let wasm_file = args. wasm_file ( ) ;
2223 let wasi_ctx = args. wasi_context ( ) ?;
23- let mut ctx = Context :: new ( wasm_file, wasi_ctx, args. fuel ( ) , args. compilation_mode ( ) ) ?;
24+ let wasm_file_full_path = std:: fs:: canonicalize ( & wasm_file) ?;
25+ let mut tracer = WasmTracer :: new ( args. tracing ( ) , & wasm_file_full_path) ;
26+ let mut ctx = Context :: new ( wasm_file, wasi_ctx, args. fuel ( ) , args. compilation_mode ( ) , & mut tracer) ?;
2427 let ( func_name, func) = get_invoked_func ( & args, & ctx) ?;
2528 let ty = func. ty ( ctx. store ( ) ) ;
2629 let func_args = utils:: decode_func_args ( & ty, args. func_args ( ) ) ?;
@@ -39,7 +42,7 @@ fn main() -> Result<()> {
3942 )
4043 }
4144
42- match func. call ( ctx. store_mut ( ) , & func_args, & mut func_results) {
45+ match func. call ( ctx. store_mut ( ) , & func_args, & mut func_results, & mut tracer ) {
4346 Ok ( ( ) ) => {
4447 print_remaining_fuel ( & args, & ctx) ;
4548 print_pretty_results ( & func_results) ;
0 commit comments