Gdb terminated by signal ?, unknown signal

I'm just trying to debug code from gdb on Mac OSX version 10.12, but always get this unknown error when running my program in gdb.

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

This is what happens:

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 received a SIGTRAP signal, but I could not understand why it now throws the Unknown signal again.

+9
c gdb macos
source share
4 answers

Solution for Mac OS X 10.12.5 and later

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

The file can be created using vi ~/.gdbinit .

Open a new terminal and gdb will work.

+9
source share

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

+2
source share

This is because you are using the latest OSX 10.12 or 10.12.1. Decreasing or waiting for OSX / GDB to fix seems like the best option. I've been thinking about this all day. Do not waste your time trying to get around it with the help of the Sierra!

+1
source share

using the new gdb 8.3, it works for me. (does not work with GDB 8.0.1 or 8.2)

0
source share

All Articles