问题很多 Mac还是老老实实用xcode吧
安装Eclipse CDT
https://eclipse.org/cdt/
安装gdb
brew install gdb
安装完,debug时如果出现如下错误,请按照此文方法解决
"Launching projectName" has encountered a problem. Error with command gdb --version
Error with command: gdb --versionCannot run program "gdb": Unknown reason
原文在此 https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html
摘出精要部分于此
Creating a Certificate
Open the Keychain Access. Select
Then click to skip the next six screens until you see the one entitled .
- Back in the main window, choose the keychain in the sidebar on the left, and select the newly created certificate from the list. Open the context menu and select . In the information window that will appear, expand the section and set the property to . Close this window (you may be asked for your password), and quit Keychain Access.
Signing GDB
You can use Activity Monitor to restart taskgated. Open it and filter the list of processes by typing taskgated
in the search field in the toolbar. (If you cannot find it, make sure the menu item is checked.)
Terminate Taskgate process . In a few seconds, it will be restarted by the system and should reappear in the list. Please wait for this to happen (it may take up to a minute or two, at worst).
Finally, in a Terminal window, run codesign -s gdbcert /usr/local/bin/gdb
(if you named your certificate differently, replace gdbcert
with its name here). Once again, you will be prompted for you username and password. If the command does not produce any output, then GDB is successfully signed.
Configuring Eclipse
The only thing left to do is to point Eclipse to the GDB executable. Open /usr/local/bin/gdb
.