@@ -33,6 +33,7 @@ pub struct Client {
33 server_tx: UnboundedSender<Payload>,
33 server_tx: UnboundedSender<Payload>,
34 request_counter: AtomicU64,
34 request_counter: AtomicU64,
35 connection_type: Option<ConnectionType>,
35 connection_type: Option<ConnectionType>,
36+ starting_request_args: Option<Value>,
36 pub caps: Option<DebuggerCapabilities>,
37 pub caps: Option<DebuggerCapabilities>,
37 // thread_id -> frames
38 // thread_id -> frames
38 pub stack_frames: HashMap<ThreadId, Vec<StackFrame>>,
39 pub stack_frames: HashMap<ThreadId, Vec<StackFrame>>,
@@ -87,6 +88,7 @@ impl Client {
87 request_counter: AtomicU64::new(0),
88 request_counter: AtomicU64::new(0),
88 caps: None,
89 caps: None,
89 connection_type: None,
90 connection_type: None,
91+ starting_request_args: None,
90 stack_frames: HashMap::new(),
92 stack_frames: HashMap::new(),
91 thread_states: HashMap::new(),
93 thread_states: HashMap::new(),
92 thread_id: None,
94 thread_id: None,
@@ -158,6 +160,10 @@ impl Client {
163+ pub fn starting_request_args(&self) -> &Option<Value> {
164+ &self.starting_request_args
161 pub async fn tcp_process(
167 pub async fn tcp_process(
162 cmd: &str,
168 cmd: &str,
163 args: Vec<&str>,
169 args: Vec<&str>,
@@ -356,14 +362,25 @@ impl Client {
357 pub fn launch(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
363 pub fn launch(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
358 self.connection_type = Some(ConnectionType::Launch);
364 self.connection_type = Some(ConnectionType::Launch);
365+ self.starting_request_args = Some(args.clone());
359 self.call::<requests::Launch>(args)
366 self.call::<requests::Launch>(args)
362 pub fn attach(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
369 pub fn attach(&mut self, args: serde_json::Value) -> impl Future<Output = Result<Value>> {
363 self.connection_type = Some(ConnectionType::Attach);
370 self.connection_type = Some(ConnectionType::Attach);
371+ self.starting_request_args = Some(args.clone());
364 self.call::<requests::Attach>(args)
372 self.call::<requests::Attach>(args)
375+ pub fn restart(&self) -> impl Future<Output = Result<Value>> {
376+ let args = if let Some(args) = &self.starting_request_args {
381+ self.call::<requests::Restart>(args)
367 pub async fn set_breakpoints(
384 pub async fn set_breakpoints(
369 file: PathBuf,
386 file: PathBuf,