@@ -33,6 +33,7 @@ pub struct Client {
3333 server_tx: UnboundedSender<Payload>,
3434 request_counter: AtomicU64,
3535 connection_type: Option<ConnectionType>,
36+ starting_request_args: Option<Value>,
3637 pub caps: Option<DebuggerCapabilities>,
3738 // thread_id -> frames
3839 pub stack_frames: HashMap<ThreadId, Vec<StackFrame>>,
@@ -87,6 +88,7 @@ impl Client {
8788 request_counter: AtomicU64::new(0),
8889 caps: None,
8990 connection_type: None,
91+ starting_request_args: None,
9092 stack_frames: HashMap::new(),
9193 thread_states: HashMap::new(),
9294 thread_id: None,
@@ -158,6 +160,10 @@ impl Client {
158160 )
159161 }
160162
163+ pub fn starting_request_args(&self) -> &Option<Value> {
164+ &self.starting_request_args
165+ }
166+
161167 pub async fn tcp_process(
162168 cmd: &str,
163169 args: Vec<&str>,
@@ -356,14 +362,25 @@ impl Client {
356362
357363 pub fn launch(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
358364 self.connection_type = Some(ConnectionType::Launch);
365+ self.starting_request_args = Some(args.clone());
359366 self.call::<requests::Launch>(args)
360367 }
361368
362369 pub fn attach(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
363370 self.connection_type = Some(ConnectionType::Attach);
371+ self.starting_request_args = Some(args.clone());
364372 self.call::<requests::Attach>(args)
365373 }
366374
375+ pub fn restart(&self) -> impl Future<Output = Result<Value>> {
376+ let args = if let Some(args) = &self.starting_request_args {
377+ args.clone()
378+ } else {
379+ Value::Null
380+ };
381+ self.call::<requests::Restart>(args)
382+ }
383+
367384 pub async fn set_breakpoints(
368385 &self,
369386 file: PathBuf,