Netbeans C++中的调试无法启动 - OSX Yosemite -

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的配置:

配置调试Netbeans

我还要按照以下步骤安装gdb:

http://ntraft.com/installing-gdb-on-os-x-mavericks/

谢谢


编辑

在netbeans上调试配置:

在此输入图像描述在此输入图像描述 在此输入图像描述

eps*_*one 5

我有同样的问题.这就是我所做的修复它(在优胜美地下):

  1. 安装brew:http://brew.sh

  2. 更新brew.如果已安装brew,请检查更新.在终端:

$ 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)
  1. 安装gdb:

$ brew install gdb
Run Code Online (Sandbox Code Playgroud)
  1. 按照这些说明对二进制文件进行编码(类似于James指出的那些):http://sourceware.org/gdb/wiki/BuildingOnDarwin为了完整起见,我在这里复制它们并添加一些注释:

创建证书

  • 启动Keychain Access应用程序(/Applications/Utilities/Keychain Access.app)

  • 打开菜单 /Keychain Access/Certificate Assistant/Create a Certificate...

  • 选择一个名称(gdb-cert在示例中),设置Identity TypeSelf Signed Root,设置Certificate TypeCode Signing并选择Let me override defaults.单击几次Continue直到进入Specify a Location For The Certificate屏幕,然后设置KeychainSystem.

  • 如果您无法将证书存储在System钥匙串中,请在钥匙串中创建login,然后将其导出.然后,您可以将其导入System钥匙串.

  • 最后,使用证书的上下文菜单,选择Get Info,打开Trust项目,然后设置Code SigningAlways Trust.

  • 您必须退出Keychain Access应用程序才能使用证书并taskgated通过终止当前正在运行的taskgated进程来重新启动服务(注释:例如with sudo pkill taskgated或restart ).

然后

授予gdb权限以控制其他进程

如果证书被称为gdb-cert,只需使用:

$ codesign -s gdb-cert gdb
Run Code Online (Sandbox Code Playgroud)

注释:如果gdb未找到,则添加安装它的路径.就我而言:

$ codesign -s gdb-cert /usr/local/Cellar/gdb/7.10/bin/gdb
Run Code Online (Sandbox Code Playgroud)
  1. 在菜单字段中使用其中一个gdb或安装gdb的路径(例如/usr/local/Cellar/gdb/7.10/bin/gdb)./Netbeans/Preferences/C/C++/Build ToolsDebugger Command field