@@ -132,10 +132,10 @@ impl Iterator for ChildListener {
132
132
return Some ( ExecEvent :: Syscall ( pid) ) ;
133
133
} ,
134
134
// Child with the given pid was stopped by the given signal.
135
- // It's somewhat dubious when this is returned instead of
136
- // WaitStatus::Stopped, but for our purposes they are the
137
- // same thing.
138
- wait:: WaitStatus :: PtraceEvent ( pid, signal, _) =>
135
+ // It's somewhat unclear when which of these two is returned;
136
+ // we just treat them the same.
137
+ wait :: WaitStatus :: Stopped ( pid , signal )
138
+ | wait:: WaitStatus :: PtraceEvent ( pid, signal, _) =>
139
139
if self . attached {
140
140
// This is our end-of-FFI signal!
141
141
if signal == signal:: SIGUSR1 {
@@ -148,19 +148,6 @@ impl Iterator for ChildListener {
148
148
// Just pass along the signal.
149
149
ptrace:: cont ( pid, signal) . unwrap ( ) ;
150
150
} ,
151
- // Child was stopped at the given signal. Same logic as for
152
- // WaitStatus::PtraceEvent.
153
- wait:: WaitStatus :: Stopped ( pid, signal) =>
154
- if self . attached {
155
- if signal == signal:: SIGUSR1 {
156
- self . attached = false ;
157
- return Some ( ExecEvent :: End ) ;
158
- } else {
159
- return Some ( ExecEvent :: Status ( pid, signal) ) ;
160
- }
161
- } else {
162
- ptrace:: cont ( pid, signal) . unwrap ( ) ;
163
- } ,
164
151
_ => ( ) ,
165
152
} ,
166
153
// This case should only trigger when all children died.
@@ -250,7 +237,7 @@ pub fn sv_loop(
250
237
// We can't trust simply calling `Pid::this()` in the child process to give the right
251
238
// PID for us, so we get it this way.
252
239
curr_pid = wait_for_signal ( None , signal:: SIGSTOP , InitialCont :: No ) . unwrap ( ) ;
253
-
240
+ // Continue until next syscall.
254
241
ptrace:: syscall ( curr_pid, None ) . unwrap ( ) ;
255
242
}
256
243
// Child wants to end tracing.
@@ -289,8 +276,7 @@ pub fn sv_loop(
289
276
}
290
277
}
291
278
} ,
292
- // Child entered a syscall; we wait for exits inside of this, so it
293
- // should never trigger on return from a syscall we care about.
279
+ // Child entered or exited a syscall. For now we ignore this and just continue.
294
280
ExecEvent :: Syscall ( pid) => {
295
281
ptrace:: syscall ( pid, None ) . unwrap ( ) ;
296
282
}
@@ -344,8 +330,8 @@ fn wait_for_signal(
344
330
return Err ( ExecEnd ( Some ( code) ) ) ;
345
331
}
346
332
wait:: WaitStatus :: Signaled ( _, _, _) => return Err ( ExecEnd ( None ) ) ,
347
- wait:: WaitStatus :: Stopped ( pid, signal) => ( signal , pid ) ,
348
- wait:: WaitStatus :: PtraceEvent ( pid, signal, _) => ( signal, pid) ,
333
+ wait:: WaitStatus :: Stopped ( pid, signal)
334
+ | wait:: WaitStatus :: PtraceEvent ( pid, signal, _) => ( signal, pid) ,
349
335
// This covers PtraceSyscall and variants that are impossible with
350
336
// the flags set (e.g. WaitStatus::StillAlive).
351
337
_ => {
0 commit comments