Not entirely sure what should happen, but I get this:
❯ lldb env/bin/python
(lldb) target create "env/bin/python"
Current executable set to '/path/to/env/bin/python' (arm64).
(lldb) r
Process 33134 launched: '/path/to/env/bin/python' (arm64)
Process 33134 stopped
* thread #2, stop reason = exec
frame #0: 0x0000000100014a40 dyld`_dyld_start
dyld`:
-> 0x100014a40 <+0>: mov x0, sp
0x100014a44 <+4>: and sp, x0, #0xfffffffffffffff0
0x100014a48 <+8>: mov x29, #0x0
0x100014a4c <+12>: mov x30, #0x0
Target 0: (Python) stopped.
(lldb)
Separately, I tried signing my python binary like this:
❯ cat entitlements.xml
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>
❯ codesign -f -s - env/bin/python --entitlements entitlements.xml
env/bin/python: replacing existing signature
❯ codesign -d -vv env/bin/python --entitlements -
Executable=/opt/homebrew/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10
Identifier=python3-555549447295e55955d43aca9820d95d1f4ae151
Format=Mach-O thin (arm64)
CodeDirectory v=20400 size=649 flags=0x2(adhoc) hashes=9+7 location=embedded
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=0 size=12
[Dict]
[Key] com.apple.security.get-task-allow
[Value]
[Bool] true
When I signed my C++ program this way, the CoreML instrument did work. However after signing python like this, it still does not work.
Also, signing python this way doesn't change the lldb output I get the same results as before signing for both lldb env/bin/python and lldb /opt/homebrew/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10.