Mac上配置C++ Eclipse 尤其是GDB错误

问题很多 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 Certificate Assistant
 -> Create a Certificate.



  1. Then click Continue to skip the next six screens until you see the one entitled Specify a Location For The Certificate
  2. Back in the main window, choose the System keychain in the sidebar on the left, and select the newly created certificate from the list. Open the context menu and select Get Info. In the information window that will appear, expand the Trust section and set the Code Signing property to Always Trust. 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 View
All Processes
 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 Eclipse -> 
Preferences
 from the main menu . In the tree of options listed in the sidebar, navigate to C/C++
Debug
GDB
, and set the GDB debugger field to /usr/local/bin/gdb.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值