Skip to content

Commit 4a2d5e3

Browse files
committed
tooling: add just trace to make it easier to run with the env vars, small debug log changes
1 parent 138b360 commit 4a2d5e3

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

crates/tracer/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl WasmTracer {
4646
}
4747

4848
pub fn load_local_variables(&mut self, address: usize) { // -> ???
49-
println!("load_local_variables {address}");
49+
// println!("load_local_variables {address}");
5050
// e.g. here we might call something like
5151
// some kind of check if we already have the info for the current context
5252
// let cached = TODO;
@@ -58,7 +58,7 @@ impl WasmTracer {
5858
self.info.push(format!("{}", self.index));
5959
self.index += 1;
6060
}
61-
println!("{:?}", self.info);
61+
// println!("{:?}", self.info);
6262
}
6363
}
6464

crates/wasmi/src/engine/executor/instrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl<'engine> Executor<'engine> {
140140
// TODO: good way to take address
141141
//let address = usize::from(self.ip.get());
142142
let address = 0x000000010; // should be in the main subprogram >= low_pc
143-
//std::println!("address of {:?}: {:?}", *self.ip.get(), address);
143+
std::println!("address of {:?}: TODO", *self.ip.get());
144144
// TODO: make this be a field with correct lifetime
145145
tracer.load_local_variables(address);
146146

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ dwarfdump wasm-path:
88
dis wasm-path:
99
# from binaryen
1010
wasm-dis {{wasm-path}}
11+
12+
trace wasm-path:
13+
env CODETRACER_WASMI_TRACING=1 CODETRACER_WASM_PATH=$(realpath {{wasm-path}}) target/debug/wasmi_cli wasm_test.wasm

wasm_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
int main() {
22
int x = 1;
3-
int y = 2;
3+
int y = 2 + x;
44
}

0 commit comments

Comments
 (0)