I\'m just trying to debug code with gdb on Mac OSX Version 10.12 but always getting this unknown error when launching my program in gdb.
I codesigned the gdb after i
This worked for me, if you are still looking for a solution:
Restart youre machine in the recovery mode, open a terminal and enter the following
$ csrutil enable --without debug
Reboot the machine and gdb should work as usual (full thread in here: http://sourceware-org.1504.n7.nabble.com/gdb-on-macOS-10-12-quot-Sierra-quot-td415708.html#a415940)
It's because you're using the latest version of OSX 10.12 or 10.12.1. Downgrading or waiting for an OSX/GDB fix seems like the best options. I've faffed around all day figuring this out. Don't waste your time trying to work around it with Sierra!
Solution for Mac OS X 10.12.5 and newer
Create a .gdbinit file in your home-direcetory and write "set startup-with-shell off" in it.
File can be created using vi ~/.gdbinit
.
Open a new terminal and gdb will work.
using new gdb 8.3, it works for me. (not working with gdb 8.0.1 or 8.2)