diff --git a/lib/runtime-core/src/tiering.rs b/lib/runtime-core/src/tiering.rs index 75688bab4..36ec19a1a 100644 --- a/lib/runtime-core/src/tiering.rs +++ b/lib/runtime-core/src/tiering.rs @@ -28,6 +28,7 @@ pub enum ShellExitOperation { pub struct InteractiveShellContext { pub image: Option, + pub patched: bool, } struct OptimizationState { @@ -178,8 +179,6 @@ pub fn run_tiering ShellExitOperation>( .as_ptr() as usize, }); n_versions.set(n_versions.get() + 1); - - eprintln!("Patched"); } // TODO: Fix this for optimized version. let breakpoints = baseline.module.runnable_module.get_breakpoints(); @@ -215,6 +214,7 @@ pub fn run_tiering ShellExitOperation>( } let op = interactive_shell(InteractiveShellContext { image: Some(new_image.clone()), + patched: n_versions.get() > 1, }); match op { ShellExitOperation::ContinueWith(new_image) => { diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 07bf68d5c..a68ef2190 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -635,37 +635,21 @@ fn interactive_shell(mut ctx: InteractiveShellContext) -> ShellExitOperation { } } "continue" | "c" => { - if let Some(image) = ctx.image.take() { - return ShellExitOperation::ContinueWith(image); + if ctx.patched { + println!("Error: Continueing execution is not yet supported on patched code."); } else { - println!("Program state not available, cannot continue execution"); - } - } - // Disabled due to unsafety. - /* - "switch_backend" => { - let backend_name = parts.next(); - if backend_name.is_none() { - println!("Usage: switch_backend [backend_name]"); - continue; - } - let backend_name = backend_name.unwrap(); - let backend = match backend_name { - "singlepass" => Backend::Singlepass, - "llvm" => Backend::LLVM, - _ => { - println!("unknown backend"); - continue; + if let Some(image) = ctx.image.take() { + return ShellExitOperation::ContinueWith(image); + } else { + println!("Program state not available, cannot continue execution"); } - }; - if let Some(image) = ctx.image.take() { - return ShellExitOperation::ContinueWith(image, Some(backend)); - } else { - println!("Program state not available, cannot continue execution"); } } - */ "backtrace" | "bt" => { + if ctx.patched { + println!("Warning: Backtrace on patched code might be inaccurate."); + } + if let Some(ref image) = ctx.image { println!("{}", image.execution_state.colored_output()); } else {