Translated processes talk with a different debugserver, shipped with macOS 11.
This patch detects whether a process is translated and attaches to the correct debugserver implementation. It's the first patch of a series. Tested on the lldb test suite.
Details
Diff Detail
Event Timeline
LGTM. With p_flag, we only need to evaluate (processInfo.kp_proc.p_flag & P_TRANSLATED) as a boolean, but that's a style pref as much as anything.
commit fd19ddb8f2a2b082f492fc59f7f360adf3495701 (HEAD -> master, origin/master, origin/HEAD) Author: Davide Italiano <ditaliano@apple.com> Date: Wed Jun 24 12:18:29 2020 -0700 [Apple Silicon] Initial support for Rosetta Translated processes talk with a different debugserver, shipped with macOS 11. This patch detects whether a process is translated and attaches to the correct debugserver implementation. It's the first patch of a series. Tested on the lldb test suite. Differential Revision: https://reviews.llvm.org/D82491
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
3444 | The sysctl call seems like something that would fit into host, we already have a bunch of those in Host.mm. Should we create a function there that returns whether a given pid runs under Rosetta? |
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
20 | This is problematic in that sys/sysctl is deprecated on linux (causing warnings/Werror failures). |
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
20 | I see you've done that already :) |
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
3444 |
This is problematic in that sys/sysctl is deprecated on linux (causing warnings/Werror failures).