diff --git a/docs/src/build.md b/docs/src/build.md index 652203851..4d3bbae99 100644 --- a/docs/src/build.md +++ b/docs/src/build.md @@ -220,3 +220,35 @@ git submodule foreach 'git lfs fetch --all && git lfs pull’ ``` Then, try to build again. + +## Common Runtime Errors + +### Debugging python on macOS + +When debugging python on macOS via lldb you may see an error like: +``` +(lldb) r +error: process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied t +he attach permission will likely have logged an informative message about why it was denied.)) +``` + +For preinstalled macOS binaries you must manually codesign with debug entitlements. + +Create file `debuggee-entitlement.xml`: +```xml + + + + + com.apple.security.cs.disable-library-validation + + com.apple.security.get-task-allow + + + +``` + +Sign the binary: +```bash +sudo codesign -f -s - --entitlements debuggee-entitlement.xml /opt/ttmlir-toolchain/venv/bin/python +```