[all-commits] [llvm/llvm-project] fa8372: [debugserver] Remove unnecessary sleep in MachProc...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Thu Nov 6 14:18:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa83723bbe55f2aee857438f8087c4fc0f52449e
      https://github.com/llvm/llvm-project/commit/fa83723bbe55f2aee857438f8087c4fc0f52449e
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2025-11-06 (Thu, 06 Nov 2025)

  Changed paths:
    M lldb/tools/debugserver/source/MacOSX/MachProcess.mm

  Log Message:
  -----------
  [debugserver] Remove unnecessary sleep in MachProcess::AttachForDebug (#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://163952037



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list