我正在努力让C ++ GDB调试器在Mac上的Eclipse中工作

时间:2020-06-16 18:46:47

标签: c++ eclipse macos debugging gdb

我在Mac 10.14.6上运行了Eclipse 2020-03(4.15.0),并从https://formulae.brew.sh/formula/gdb安装了带有Homebrew的GDB,据我所知,该数据库已正确安装。

which gdb给我/ usr / local / bin / gdb

gdb --version给出9.2

我已经在 Eclipse-PREFERENCES> C ++> DEBUG> GDB

中设置了路径

我尝试按照以下链接中的说明对gdb二进制文件进行签名;

https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html

https://sourceware.org/gdb/wiki/PermissionsDarwin

https://www.youtube.com/watch?v=JdcpDOf5Sog

但到目前为止,似乎没有一个...

当我在Eclipse中设置一个断点并尝试调试时,它不会出错(就像在安装gdb之前一样),但是它只会提供类似于以下内容的输出;

19:32:53 **** Incremental Build of configuration Debug for project test ****
make all 
make: Nothing to be done for `all'.

19:32:53 Build Finished. 0 errors, 0 warnings. (took 97ms)

我简要记录了正在发生的事情,这并不好,但是如果您以高清格式观看,则可以大致了解我在做什么,并且可以提供有关发生问题的线索;

https://www.youtube.com/watch?v=AUKdURVIbs8

我对Eclipse并不是很失败,并且确实不将其用于Java,而是更喜欢Netbeans,但有点需要在这里将其用于C ++东西,所有建议都将不胜感激。

更新1:我也在Netbeans(8.2)中尝试过并出现错误

GDB has unexpectedly stopped with return 1

与此处的其他线程类似,但不幸的是无法针对Netbeans或Eclipse进行解析。

更新2:我试图从命令行运行gdb,如下所示:

我已经将测试应用程序编译为;

g++ test.cpp -g -Wall -Werror -o test.o

然后我用以下命令启动调试器:

gdb test.o

设置断点:

break 4

最后运行:

run

然后我得到以下输出:

Starting program: /Volumes/D_SLAVE/My Documents/My Projects/Code Ready Studio/C_test/src/test.o 
Unable to find Mach task port for process-id 15719: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

好,所以有一些进展,也许是签名不正确,请检查:

codesign --verify --verbose /usr/local/bin/gdb

我得到以下输出:

/usr/local/bin/gdb: valid on disk
/usr/local/bin/gdb: satisfies its Designated Requirement

我认为这表明二进制文件(在本例中为gdb)的确正确签名。

更新3:我已经解决了更新2 中报告的问题,目前gdb二进制文件已经签名,并且能够按预期运行仔细按照

中的说明进行操作

https://sourceware.org/gdb/wiki/BuildingOnDarwin

https://sourceware.org/gdb/wiki/PermissionsDarwin

但是对于Eclipse或Netbeans仍然不满意。

因此仍然茫然,不胜感激。

0 个答案:

没有答案
相关问题