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
assume your MacOS version is 10.12.6.
brew upgrade gdbecho "set startup-with-shell off" >> ~/.gdbinit ( I saw this command when I installed gdb by brew )gdb-cert and trust this certificate in code signing optionsudo codesign -s gdb-cert /usr/local/bin/gdbBTW,you can use lldb to replace gdb .