簡體   English   中英

gdb終止了信號?,未知信號

[英]gdb terminated with signal ?, unknown signal

我只是試圖在Mac OSX版本10.12上使用gdb調試代碼,但在gdb中啟動程序時總是會收到此未知錯誤。

我在安裝后對gdb進行了編碼,並使用-g標志編譯了我的代碼。

這就是發生的事情:

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信號,但我無法弄清楚為什么它現在再次拋出未知信號。

適用於Mac OS X 10.12.5及更高版本的解決方案

在home-direcetory中創建一個.gdbinit文件,並在其中寫入“set startup-with-shell off”。

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

打開一個新的終端,gdb將工作。

如果您仍在尋找解決方案,這對我有用:

這是因為您使用的是最新版本的OSX 10.12或10.12.1。 降級或等待OSX / GDB修復似乎是最好的選擇。 我整天都在弄清楚這一點。 不要浪費你的時間嘗試與Sierra一起解決它!

使用新的gdb 8.3,它適用於我。 (不使用gdb 8.0.1或8.2)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM