GDB kind of doesn't work on macOS Sierra

前端 未结 8 773
梦毁少年i
梦毁少年i 2020-12-02 07:55

It is a problem that appeared when I first updated to macOS Sierra yesterday.

GDB itself is running OK. However, somehow, it cannot run my program. When I type \'run

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 08:11

    assume your MacOS version is 10.12.6.

    1. upgrade your gdb to version 8.0.1 brew upgrade gdb
    2. execute echo "set startup-with-shell off" >> ~/.gdbinit ( I saw this command when I installed gdb by brew )
    3. create a certificate with name gdb-cert and trust this certificate in code signing option
    4. reboot your mac
    5. execute sudo codesign -s gdb-cert /usr/local/bin/gdb
    6. done! have a fun ~

    BTW,you can use lldb to replace gdb .

提交回复
热议问题