Q:
My program is determined to stop its execution by hitting CTRL+C in command window. By now, i have a critical error right in this stopping phase, so i want to debug with gdb.
Problem is, gdb redefines CTRL+C as its own interrupt and pauses the execution whet hitted. How can i handle it that CTRL+C powers my programm off and gdb can catch the stack trace?
A:
rom the (gdb)
prompt, type signal SIGINT
. This will send (surprize) SIGINT
to the program being debugged.
Alternatively, handle SIGINT nostop print pass
will make GDB pass the signal straight to the inferior (being debugged) process.