【发布时间】:2018-05-15 20:06:27
【问题描述】:
我已经通过自制软件在我的 Mac(使用 Mac OS 10.9 / Mavericks)上安装了 gdb 并成功对其进行了代码签名。
在使用 gdb 开始调试会话之前,我编译了我的 C 文件,如下例所示:
gcc -g test.c -o test
后来我打电话给gdb:
Users-MacBook-Pro:Test User$ gdb ./test
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 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.
This GDB was configured as "x86_64-apple-darwin13.4.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/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./test...Reading symbols from /Users/User/Test/test.dSYM/Contents/Resources/DWARF/test...done.
done.
调用 r 或 sta 等 gdb 命令总是会导致以下错误:
(gdb) r
Abort trap: 6
有什么问题?任何想法如何解决它?
【问题讨论】:
-
数字 6 (可能)是代表
SIGABRT的数字,通常只能通过调用abort()来调用。 -
我对 Mac 上的
gdb有不同的问题,但它可能是相关的:stackoverflow.com/questions/11504377/… -
同样的问题,在 OSX 10.11.6 (El Capitan) 上。我的测试程序只添加了 2 个整数并返回 0- 绝对没有调用“中止”,并且它在没有 gdb 的情况下运行良好。有什么解决办法吗?
-
我尝试了其他帖子中提出的几件事,包括重新安装 gdb 和更新证书。但直到现在我都无法让 gdb 工作......
-
@HerthaBSC 我遇到了同样的问题。你那边有什么决议吗?在 OSX El Capitan 10.11.6 上。使用
g++-7 (Homebrew GCC 7.3.0) 7.3.0编译并使用 gdbGNU gdb (GDB) 8.1
标签: c macos gdb homebrew osx-mavericks