use*_*321 2 c++ debugging macos gdb netbeans
我无法为C++ osx Yosemite进行调试(我尝试了不同的IDE,每个都有问题),我在google install gdb上看到了brew ......但没有.使用NetBeans,启动调试,并在控制台输出中获取shell gdb:
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3 +: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
--- Type <return> to continue, or q <return> to quit ---
This GDB was configured as "x86_64-apple-darwin14.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
--- Type <return> to continue, or q <return> to quit ---
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb)
Run Code Online (Sandbox Code Playgroud)
我想调试使用netbeans gui驱动,步入,跳过等....这是netbeans的配置:

我还要按照以下步骤安装gdb:
http://ntraft.com/installing-gdb-on-os-x-mavericks/
谢谢
编辑
在netbeans上调试配置:


我有同样的问题.这就是我所做的修复它(在优胜美地下):
$ brew update
Run Code Online (Sandbox Code Playgroud)
这一步对我来说是决定性的,因为在更新之前,brew没有找到任何gdb包:
$ brew install gdb # Error: No available formula for gdb
Run Code Online (Sandbox Code Playgroud)
在那之后:
$ brew update
$ brew search | grep gdb # cgdb gdb gdbm pgdbf
Run Code Online (Sandbox Code Playgroud)
$ brew install gdb
Run Code Online (Sandbox Code Playgroud)
创建证书
启动Keychain Access应用程序(
/Applications/Utilities/Keychain Access.app)打开菜单
/Keychain Access/Certificate Assistant/Create a Certificate...选择一个名称(
gdb-cert在示例中),设置Identity Type为Self Signed Root,设置Certificate Type为Code Signing并选择Let me override defaults.单击几次Continue直到进入Specify a Location For The Certificate屏幕,然后设置Keychain为System.如果您无法将证书存储在
System钥匙串中,请在钥匙串中创建login,然后将其导出.然后,您可以将其导入System钥匙串.最后,使用证书的上下文菜单,选择
Get Info,打开Trust项目,然后设置Code Signing为Always Trust.您必须退出Keychain Access应用程序才能使用证书并
taskgated通过终止当前正在运行的taskgated进程来重新启动服务(注释:例如withsudo pkill taskgated或restart ).
然后
授予gdb权限以控制其他进程
如果证书被称为
gdb-cert,只需使用:Run Code Online (Sandbox Code Playgroud)$ codesign -s gdb-cert gdb注释:如果
gdb未找到,则添加安装它的路径.就我而言:Run Code Online (Sandbox Code Playgroud)$ codesign -s gdb-cert /usr/local/Cellar/gdb/7.10/bin/gdb
gdb或安装gdb的路径(例如/usr/local/Cellar/gdb/7.10/bin/gdb)./Netbeans/Preferences/C/C++/Build ToolsDebugger Command field| 归档时间: |
|
| 查看次数: |
6407 次 |
| 最近记录: |