Beginning with Mavericks (macOS 10.9) Xcode stopped supporting the gdb debugger. Below are steps to walk you through solving this not-so-straight...
For further actions, you may consider blocking this person and/or reporting abuse
Or you can use
lldb
instead! I found myself much happier after switching for debugging and program analysis tasks. Saved time from fighting the system and this is updated regularly with the macOS tool chains.If your application forks child processes, gdb supports following the forks. lldb unfortunately does not, and you have to workaround this with debug code to delay the child startup and re-attach to the PID. More here: stackoverflow.com/questions/147463...
Agreed! Unfortunately I'm taking a class that requires gdb.
After typing break (line number), hitting enter and then typing run (or run [args]) I get "Starting program: /Users/diegoesparza/CS_Ventures/LearnC/factorial [args]
[New Thread 0x2303 of process 795]" followed by a blank line which does not respond to anything I type. Does anyone else get this? I have searched around and tried different ways of installing gdb but I get the same thing
When I run the following command below, I receive an error of 'cannot read entitlement data'. What can I do to resolve this?
Maybe you didn't make
gdb-entitlement.xml
file described in the directions?I followed this and I no longer get the gdb is codesigned error; however, everytime I run gdb it goes into a new thread and nothing happens unless I press ctrl z :(
Hello Jason, Thank you for this post it helped me a lot setting up gdb on MacOS Monterey. The project I am working on must use gdb and CodeBlocks dev environment. From a terminal I can run gdb OK, but from CodeBlocks it sometimes crashes the environment. Do you have some experience in such a setup or could you point me in the correct direction ? Thank you.
Thank you for this, I found it very helpful.
I have completed the gdb path linking part too but it shows an error for code signed. Then it says zsh: parse error near '\n' . Can someone help me here. what should I do from here?
Git rid of <> from this line:
codesign --entitlements gdb-entitlement.xml -fs gdb-cert
I made every thing following the instructions above .. but at "Sign the certificate for gdb" I receive the follow error:
"error: The specified item could not be found in the keychain." But the certificate is in KeyChain.
Please can someone help me to sort it out.
I am using an old 2010 - 2012 Mac Pro and working with Code Lite for a C++ class. My OS is Mojave. I was not able to generate the certificate using the method above. However, I followed the following steps to generate the certificate:
opensource.apple.com/source/lldb/l...
Then your steps Signing the Certificate and then Create a gdb Command File made it all work. Thanks.
When trying to create the certificate I get "Unknown error=-2,147,414,007" MacOS 10.13.4. gdb 10.1. Thanks.
Checkout the first ref in the article (section 'Troubleshooting the certificate generation')
gdb-entitlement.xml: cannot read entitlement data
Wonderful post. Thank you
I get this problem when trying to sign the certificate as per the instructions