Add commands and status to debugging interface.

This commit is contained in:
Stephen Chung
2022-02-01 22:30:05 +08:00
parent dca0185323
commit 7163a7331a
11 changed files with 351 additions and 183 deletions

View File

@@ -905,11 +905,15 @@ impl Engine {
Ok((
if let Expr::Stack(slot, _) = arg_expr {
#[cfg(feature = "debugging")]
self.run_debugger(scope, global, state, lib, this_ptr, arg_expr, level)?;
if self.debugger.is_some() {
self.run_debugger(scope, global, state, lib, this_ptr, arg_expr, level)?;
}
constants[*slot].clone()
} else if let Some(value) = arg_expr.get_literal_value() {
#[cfg(feature = "debugging")]
self.run_debugger(scope, global, state, lib, this_ptr, arg_expr, level)?;
if self.debugger.is_some() {
self.run_debugger(scope, global, state, lib, this_ptr, arg_expr, level)?;
}
value
} else {
self.eval_expr(scope, global, state, lib, this_ptr, arg_expr, level)?
@@ -1155,7 +1159,9 @@ impl Engine {
let first_expr = first_arg.unwrap();
#[cfg(feature = "debugging")]
self.run_debugger(scope, global, state, lib, this_ptr, first_expr, level)?;
if self.debugger.is_some() {
self.run_debugger(scope, global, state, lib, this_ptr, first_expr, level)?;
}
// func(x, ...) -> x.func(...)
a_expr.iter().try_for_each(|expr| {
@@ -1239,7 +1245,10 @@ impl Engine {
// &mut first argument and avoid cloning the value
if !args_expr.is_empty() && args_expr[0].is_variable_access(true) {
#[cfg(feature = "debugging")]
self.run_debugger(scope, global, state, lib, this_ptr, &args_expr[0], level)?;
if self.debugger.is_some() {
let node = &args_expr[0];
self.run_debugger(scope, global, state, lib, this_ptr, node, level)?;
}
// func(x, ...) -> x.func(...)
arg_values.push(Dynamic::UNIT);