Commit fa83723
authored
[debugserver] Remove unnecessary sleep in MachProcess::AttachForDebug (llvm#166674)
Remove the unnecessary sleep in MachProcess::AttachForDebug. The
preceding comment makes it seem like it's necessary for synchronization,
though I don't believe that's the case (see below), and even if it were,
sleeping is not a reliable way to achieve that.
The reason I don't believe it's necessary is because after we return, we
synchronize with the exception thread on a state change. The latter will
call and update the process state, which is exactly what we synchronize
on. I was able to verify that this is the first time we change the
process state: i.e., `GetState` doesn't return a different value before
and after the sleep.
On top of that, there are 3 more places where we call ptrace attach
(`PosixSpawnChildForPTraceDebugging`, `SBLaunchForDebug`, and
`BoardServiceLaunchForDebug`) where we don't sleep.
rdar://1639520371 parent 4b4bfe9 commit fa83723
1 file changed
+0
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2853 | 2853 | | |
2854 | 2854 | | |
2855 | 2855 | | |
2856 | | - | |
2857 | | - | |
2858 | | - | |
2859 | | - | |
2860 | | - | |
2861 | | - | |
2862 | 2856 | | |
2863 | 2857 | | |
2864 | 2858 | | |
| |||
0 commit comments