gdb以信号?,未知信号终止 [英] gdb terminated with signal ?, unknown signal

查看:95
本文介绍了gdb以信号?,未知信号终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac OSX V10.12上用gdb调试代码,但是在gdb启动我的程序时总是得到这个未知的错误。



我对gdb安装完成后,用-g标记编译我的代码。



这就是发生了什么:

 计算机:hello用户$ gdb a.out 
GNU gdb(GDB)7.12
版权(C)2016自由软件基金会,Inc.
许可证GPLv3 +:GNU GPL版本3或更高版本< http://gnu.org/licenses/gpl.html>
这是免费软件:您可以自由更改和重新分配它。
在法律允许的范围内,不存在任何担保。有关详细信息,请键入显示复制
和显示保修。
这个GDB被配置为x86_64-apple-darwin16.0.0。
输入显示配置以获取配置详细信息。
有关错误报告的说明,请参阅:
< http://www.gnu.org/software/gdb/bugs/> ;.
在线查找GDB手册和其他文档资源:
< http://www.gnu.org/software/gdb/documentation/> ;.
如需帮助,请输入help。
键入apropos word以搜索与word相关的命令...
从a.out中读取符号...从/ Users / user / Documents / Programming / hello / a中读取符号。 out.dSYM /内容/资源/ DWARF / a.out的...来完成。
完成。
(gdb)r
启动程序:/Users/user/Documents/Programming/hello/a.out
启动程序在信号?,未知信号时终止。

暂时我得到了SIGTRAP信号,但我无法弄清楚为什么现在再次抛出Unknown信号。

解决方案

适用于Mac OS X 10.12.5及更新版本的解决方案

在home-direcetory中创建一个.gdbinit文件,并在其中写入set startup-with-shell off。

文件可以使用 vi〜/ .gdbinit

创建。

打开一个新的终端并使用gdb。


I'm just trying to debug code with gdb on Mac OSX Version 10.12 but always getting this unknown error when launching my program in gdb.

I codesigned the gdb after installation and compiled my code with the -g flag.

This is what is happening:

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.

Temporary I got the SIGTRAP signal, but I could not figure out why it's now throwing the Unknown signal again.

解决方案

Solution for Mac OS X 10.12.5 and newer

Create a .gdbinit file in your home-direcetory and write "set startup-with-shell off" in it.

File can be created using vi ~/.gdbinit.

Open a new terminal and gdb will work.

这篇关于gdb以信号?,未知信号终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆