I have installed gdb 8.1 with brew.
I have codesign gdb also and .gdbinit as below:
$ cd gdb-7.11 gdb-7.11$./configure gdb-7.11$ make This step will take a bit of time. So you can sit back and have cup of coffee for a while. Once it is completed, you can locate gdb binary located at gdb-7.11/gdb/gdb. Step-4: Install GDB. $ make install By default this will install gdb binaries in /usr/local/bin and libs in /usr/local/lib. Once you have Homebrew, you can install gdb. If you're using High Sierra (macOS 10.13) or later, be aware that gdb 8.1 and 8.2 are not compatible. You can either use gdb 8.0.1 or one of the latest versions, starting from 8.3. In this tutorial, I'm going to use gdb 8.3. Cd gdb-7.12.1 in terminal to open the gdb folder then follow the instructions in the README file in the gdb folder, or simply follow the following steps./configure, wait for the terminal make and wait again (which can take some time). Install Disk Creator is a straightforward way to create a boot disk. I was able to make a macOS Sierra external USB boot disk in a few minutes, and the installation worked without a hitch.
set startup-with-shell off.
I have disabled SIP feature:
But gdb still doesn’t work:
Compile command:
gdb output:
What correct steps to make gdb work on macos sierra?
This is caused by latest gdb 8.1, downgrade gdb to 8.0.1 could solve this problem.
brew unlink gdb
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula/gdb.rb
brew pin gdb
in my case downgrading to 8.0.1 didn't help.
but the following steps helped.
(i inserted step 12, 'check if it works' because, instead of restarting i've tested gdb and it worked just fine. i didn't follow the steps 12+)
gdb-cert
)killall taskgated
codesign -fs gdb-cert /usr/local/bin/gdb
command-R
until apple logo appears)csrutil enable --without debug
information source:
pre Sierra: https://gist.github.com/hlissner/898b7dfc0a3b63824a70e15cd0180154
Sierra: https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d
I'm using macOS 10.13.6 and I was having the same issue that ' (please check gdb is codesigned - see taskgated(8))' ...
When I downgraded the GDB from 8.2.1 to 8.0.1 and then created and signed the gdb-cert again and it simply worked..
Don't forget to change the path of gdb from 8.2.1 to 8.0.1 in debugger of eclipse, restart and it will work.
Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra.Run brew install gdb
.On starting gdb, you will get the following error:
To fix this error, follow the following steps:
gdbcert
)Certificate Error: Unknown Error =-2,147,414,007
Set Location to Login, Unlock System by click on the lock at the top left corner and drag and drop the certificate gdbcert to the System Keychain.Always Trust
killall taskgated
codesign -fs gdbc /usr/local/bin/gdb
csrutil enable --without debug