首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gdb终止,信号?,未知信号

gdb终止,信号?,未知信号
EN

Stack Overflow用户
提问于 2016-10-15 05:20:12
回答 4查看 6.9K关注 0票数 9

我只是尝试在Mac版本10.12上使用gdb调试代码,但在gdb中启动我的程序时总是收到这个未知错误。

我在安装之后共同设计了gdb,并使用-g标志编译了我的代码。

这就是正在发生的事情:

代码语言:javascript
复制
computer:hello user$ gdb a.out
GNU gdb (GDB) 7.12
Copyright (C) 2016 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-darwin16.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/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...Reading symbols from /Users/user/Documents/Programming/hello/a.out.dSYM/Contents/Resources/DWARF/a.out...done.
done.
(gdb) r
Starting program: /Users/user/Documents/Programming/hello/a.out 
During startup program terminated with signal ?, Unknown signal.

暂时我收到了SIGTRAP信号,但我不明白为什么它现在又抛出了未知信号。

EN

回答 4

Stack Overflow用户

发布于 2017-06-29 15:52:57

适用于Mac 10.12.5和更高版本的解决方案

在您的主目录中创建一个.gdbinit文件,并在其中写入"set startup-with-shell off“。

可以使用vi ~/.gdbinit创建文件。

打开一个新的终端,gdb就可以工作了。

票数 9
EN

Stack Overflow用户

发布于 2016-11-08 02:57:02

这对我很有效,如果你还在寻找解决方案:

  • 在恢复模式下重新启动您的计算机,打开终端并输入以下内容

$ csrutil enable --without debug

重启机器,gdb应该像往常一样工作(这里是全线程:http://sourceware-org.1504.n7.nabble.com/gdb-on-macOS-10-12-quot-Sierra-quot-td415708.html#a415940)

票数 2
EN

Stack Overflow用户

发布于 2016-11-01 10:20:33

这是因为您使用的是OSX 10.12或10.12.1的最新版本。降级或等待OSX/GDB修复似乎是最好的选择。我花了一整天的时间来弄清楚这件事。不要浪费你的时间去尝试解决这个问题!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40052171

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档