Support call stack and FunctionExit for native functions.

This commit is contained in:
Stephen Chung
2022-02-02 14:47:35 +08:00
parent 7163a7331a
commit 4a80483749
13 changed files with 190 additions and 77 deletions

View File

@@ -270,10 +270,30 @@ fn main() {
}
}
DebuggerEvent::FunctionExitWithValue(r) => {
println!("! Return from function call = {}", r)
println!(
"! Return from function call '{}' => {}",
context
.global_runtime_state()
.debugger
.call_stack()
.last()
.unwrap()
.fn_name,
r
)
}
DebuggerEvent::FunctionExitWithError(err) => {
println!("! Return from function call with error: {}", err)
println!(
"! Return from function call '{}' with error: {}",
context
.global_runtime_state()
.debugger
.call_stack()
.last()
.unwrap()
.fn_name,
err
)
}
}