Mario P. Waxenegger
Mario P. Waxenegger

Reputation: 489

gdb terminated with signal ?, unknown signal

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.

Upvotes: 9

Views: 7648

Answers (4)

Bob Yoplait
Bob Yoplait

Reputation: 2499

using new gdb 8.3, it works for me. (not working with gdb 8.0.1 or 8.2)

Upvotes: 0

lakeslove
lakeslove

Reputation: 99

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.

Upvotes: 9

s.yadegari
s.yadegari

Reputation: 602

This worked for me, if you are still looking for a solution:

Upvotes: 2

user4992332
user4992332

Reputation: 21

It's because you're using the latest version of OSX 10.12 or 10.12.1. Downgrading or waiting for an OSX/GDB fix seems like the best options. I've faffed around all day figuring this out. Don't waste your time trying to work around it with Sierra!

Upvotes: 1

Related Questions