wasm: improve debug logging

This commit is contained in:
Brian Carroll 2022-04-07 11:53:10 +01:00
parent 6de8892e88
commit 5cce24bc8f
3 changed files with 16 additions and 7 deletions

View file

@ -62,7 +62,7 @@ struct VmBlock<'a> {
impl std::fmt::Debug for VmBlock<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!("{:?}", self.opcode))
f.write_fmt(format_args!("{:?} {:?}", self.opcode, self.value_stack))
}
}
@ -608,7 +608,7 @@ impl<'a> CodeBuilder<'a> {
log_instruction!(
"{:10}\t\t{:?}",
format!("{:?}", opcode),
self.current_stack()
self.vm_block_stack
);
}
@ -635,7 +635,7 @@ impl<'a> CodeBuilder<'a> {
"{:10}\t{}\t{:?}",
format!("{:?}", opcode),
immediate,
self.current_stack()
self.vm_block_stack
);
}
@ -648,7 +648,7 @@ impl<'a> CodeBuilder<'a> {
format!("{:?}", opcode),
align,
offset,
self.current_stack()
self.vm_block_stack
);
}
@ -752,7 +752,7 @@ impl<'a> CodeBuilder<'a> {
"{:10}\t{}\t{:?}",
format!("{:?}", CALL),
function_index,
self.current_stack()
self.vm_block_stack
);
}
@ -823,7 +823,7 @@ impl<'a> CodeBuilder<'a> {
"{:10}\t{}\t{:?}",
format!("{:?}", opcode),
x,
self.current_stack()
self.vm_block_stack
);
}
pub fn i32_const(&mut self, x: i32) {