File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use super::*;
77use adapter_protocol:: * ;
88use lldb:: * ;
99use std:: ffi:: OsStr ;
10+ use std:: time:: Duration ;
1011
1112impl super :: DebugSession {
1213 pub ( super ) fn report_launch_cfg_error ( & mut self , err : serde_json:: Error ) -> Result < ResponseBody , Error > {
@@ -359,12 +360,15 @@ impl super::DebugSession {
359360 // Resume before sending the signal.
360361 log_errors ! ( process. resume( ) ) ;
361362 for _ in 0 ..10 {
362- if process. state ( ) . is_running ( ) {
363+ let state = process. state ( ) ;
364+ // Sleep unconditionally; without this pause signals sometimes never arrive.
365+ std:: thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
366+ if state. is_running ( ) {
363367 break ;
364368 }
365- std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 100 ) ) ;
366369 }
367370 }
371+ debug ! ( "Sending signal {signo}" ) ;
368372 process. signal ( signo) ?;
369373 }
370374 Some ( Either :: Second ( commands) ) => {
Original file line number Diff line number Diff line change 11use crate :: prelude:: * ;
22use std:: sync:: Arc ;
3+ use std:: time:: Duration ;
34use std:: { env, net} ;
45
56use adapter_protocol:: AdapterSettings ;
@@ -8,7 +9,6 @@ use dap_session::DAPChannel;
89use lldb:: * ;
910use tokio:: io:: AsyncWriteExt ;
1011use tokio:: net:: { TcpListener , TcpStream } ;
11- use tokio:: time:: Duration ;
1212use tokio_util:: codec:: Decoder ;
1313
1414#[ allow( unused_imports) ]
You can’t perform that action at this time.
0 commit comments