Is there any way to convince lldb to log error messages instead of
referring me to the console … ?
No, because the API that’s failing on LLDB does not return comprehensive error information (IIRC LLDB is just getting back
EPERM).
which contains a continuous stream of noise
These log entries are only “noise” if they don’t apply to your specific situation (-: The trick here is to filter. In this case I recommend the following:
Reproduce the problem.
Run log collect.
Open the resulting .logarchive with Console.
Search for debugserver entries.
Search backwards from there to find a more detailed explanation.
In my test, where I tried attaching to the Finder, I saw this:
type: default
time: 2021-03-16 12:23:23.970146 +0000
process: kernel
category: <Missing Description>
message: macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (Finder) (pid: 448): (Finder) is hardened, (Finder) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
which is pretty clear: I can’t attach to the Finder because the executable has the
hardened runtime enabled but doesn’t have the get-task-allow entitlement set [1].
Why would lldb, running as my local user, be unable to launch a
process also running as my local user?
There are
lots of reasons why LLDB might not be able to attach, which is why it points you to the system log rather than trying to diagnose the issue itself. These mostly boil down to the way that the program is signed. For example, consider this:
Code Block % codesign -d -vvv --entitlements :- /Applications/QProcessDock.app |
… |
CodeDirectory v=20500 size=1365 flags=0x10000(runtime) … |
… |
<plist version="1.0"> |
<dict/> |
</plist> |
This app has the hardened runtime set (hence the
runtime flag). This enables a bunch of extra security features by default, and one of those is to prevent the debugger from attaching. You can re-enable this by setting the get-task-allow entitlement (
com.apple.security.get-task-allow) but in this specific case that’s not set.
As to what’s preventing
chrome-token-signing from running, it’s hard to say without more info. Try the diagnostics I’ve outlined above and let us know what you see.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"[1] Actually, the Finder is a platform binary so it doesn’t have to opt in to the hardened runtime because that’s enabled by default for all platform binaries.