diff --git a/gui/src/main.rs b/gui/src/main.rs
index 43ab53c89..a006a623a 100644
--- a/gui/src/main.rs
+++ b/gui/src/main.rs
@@ -20,7 +20,7 @@ use futures::{
};
use slint::{ComponentHandle, ModelRc, SharedString, ToSharedString, VecModel};
use std::cell::{Cell, RefMut};
-use std::net::SocketAddrV4;
+use std::net::SocketAddr;
use std::path::PathBuf;
use std::process::ExitCode;
use std::rc::Rc;
@@ -223,7 +223,11 @@ async fn run(args: ProgramArgs, exe: PathBuf) -> Result<(), ProgramError> {
match exit {
ExitAction::Run => (profile, None),
- ExitAction::RunDebug(v) => (profile, Some(v)),
+ ExitAction::Debug => {
+ let addr = profile.debug_addr().clone();
+
+ (profile, Some(addr))
+ }
}
};
@@ -333,15 +337,18 @@ async fn run_launcher(
let win = win.as_weak();
let profiles = profiles.clone();
let exit = exit.clone();
+ let ty = ExitAction::Run;
- move || spawn_handler(&win, |w| start_vmm(w, profiles.clone(), exit.clone()))
+ move || spawn_handler(&win, |w| start_vmm(w, profiles.clone(), exit.clone(), ty))
});
win.on_start_debug({
let win = win.as_weak();
+ let profiles = profiles.clone();
let exit = exit.clone();
+ let ty = ExitAction::Debug;
- move || todo!()
+ move || spawn_handler(&win, |w| start_vmm(w, profiles.clone(), exit.clone(), ty))
});
// Set window properties.
@@ -384,7 +391,7 @@ async fn run_launcher(
Ok(Some((profile, exit)))
}
-async fn wait_for_debugger(addr: SocketAddrV4) -> Result