I am trying to use gdb on Mac OSX High Sierra. I installed version 8.01 using brew (the latest version 8.1 actually has a separate unrelated error ) and I am having problems with the code step. I follow the instructions on the page suggested by brew .
In Keychain Access, I create a certificate using the "codeign" option and overriding the default values, and scroll through until it asks for the location of the certificate for which I select "keychain: system". However, right after that I get a cryptic message:
An Error Occurred Unknown Error = -2,147,414,007
This post also happened in a previous thread , but the only answer was poor quality, didn't work, and the question didn't seem to get much activity / attention. I also tried going into recovery mode and doing csrutil disable , but I still get the error -2,147,414,007 . We return to the "Access to the keychain" window in the "System" section, I get the public and private RSA keys of the newly created certificate, but the certificate itself is missing.
If I repeat all this, but create in the "Login" section instead of "System", and this time the certificate will be created. Then I export to the .cer file on my desktop, and then import it back into Keychains, but under the "System" category. Then i restart the computer and then
codesign -s gdb-cert /usr/local/Cellar/gdb/8.0.1/bin/gdb
but I get error: The specified item could not be found in the keychain. .
I can, of course, just make sudo gdb or lldb without problems, but I would like to use gdb with emacs , so they are not parameters (of course, technically I can just make sudo emacs and it will work, but for obvious reasons, I prefer not to use sudo ). How can I encode gdb so that I can use it without receiving a mach port complaint?
edit: another thread appears elsewhere has many people with the same problem. There does not appear to be a final correction; I tried some of the suggestions and keep getting
Unable to find Mach task port for process-id 575: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8))