File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -964,15 +964,17 @@ impl Drop for Debugger {
964
964
965
965
// todo currently ok only if all threads in group stop
966
966
// continue all threads with SIGSTOP
967
- current_tids. iter ( ) . for_each ( |tid| {
968
- sys:: ptrace:: cont ( * tid, Signal :: SIGSTOP ) . expect ( "cont debugee" ) ;
969
- } ) ;
970
- current_tids. iter ( ) . for_each ( |tid| {
971
- waitpid ( * tid, None ) . expect ( "waiting debugee" ) ;
972
- } ) ;
967
+ let prepare_stopped: Vec < _ > = current_tids
968
+ . into_iter ( )
969
+ . filter ( |& tid| sys:: ptrace:: cont ( tid, Signal :: SIGSTOP ) . is_ok ( ) )
970
+ . collect ( ) ;
971
+ let stopped: Vec < _ > = prepare_stopped
972
+ . into_iter ( )
973
+ . filter ( |& tid| waitpid ( tid, None ) . is_ok ( ) )
974
+ . collect ( ) ;
973
975
// detach ptrace
974
- current_tids . iter ( ) . for_each ( |tid| {
975
- sys:: ptrace:: detach ( * tid, None ) . expect ( "detach debugee " ) ;
976
+ stopped . into_iter ( ) . for_each ( |tid| {
977
+ sys:: ptrace:: detach ( tid, None ) . expect ( "detach tracee " ) ;
976
978
} ) ;
977
979
// kill debugee process
978
980
signal:: kill ( self . debugee . tracee_ctl ( ) . proc_pid ( ) , Signal :: SIGKILL )
You can’t perform that action at this time.
0 commit comments