文章目录
Prerequisites
- MacOS X Mojave (10.14.x).
- Met problems considering Codesign and During startup program terminated with signal … / unknown load command 0x32, etc.
- Do NOT install
gdb
in advance. If you already have it (withbrew
for example), make a clean uninstallation (e.g.brew uninstall --force gdb
).
Steps
如下是在 Mojave 上 GDB Debugger 安装使用踩坑后,最终成功的步骤总结。
Please strictly follow these steps. This procedure is what finally works or me. Major reference is Permission Darwin | GDB Wiki 1 and 49001329 | Stackoverflow 2.
Turn off System Intergrity (Debugging Component)
- Shut down your Mac. Turn it on again, hold
cmd + R
when booting up, until logo shows up. You should now be booting into Recovery Mode. - Select a language and enter the Recovery Mode UI. In the Menu, select “Utilities” → \rightarrow → “Terminal” to open a terminal.
- Run the command
csrutil enable --without debug
. It won’t turn off system integrity protection entirely, only the Debugging Restriction component is turned off. This should be enough. - Reboot normally.
- Check
csrutil status
in your terminal to see if the Debugging