Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qt creator stops on Linux signal

I have created a HUP signal handler in linux only C++ app (as per QT link) and am working in QT Creator 5.1. The code compiles and runs fine in QT Creator, but when I send the HUP signal from a command line, QT Creator stops with a popup:

"The inferior stopped because it received a signal from the operating system" along with HUP signal information.

If I click the CONTINUE button on the debug panel I see my qDebug statements printout from my HUP signal handler in my code. My question is, is this normal behaviour? Why is QT Creator trapping HUP and stopping my code, when my code is properly handling the HUP signal?

like image 573
TSG Avatar asked Oct 16 '13 17:10

TSG


1 Answers

Just uncheck the box "Show a message box when receiving a signal" in Tools -> Options... -> Debugger -> GDB.

P.S. Of course that concerns only a popup window in Qt Creator, but the main part is a debugger. If you want gdb not to catch a signal but pass it to your program, you need to give gdb a command like the following: handle SIGHUP pass nostop noprint (see Window -> Views -> Debugger Log or Tools -> Options... -> Debugger -> Locals & Expressions -> Debugging Helper Customization (like the image below for the SIGINT signal)).

enter image description here

like image 141
Anton N. Petrov Avatar answered Sep 20 '22 05:09

Anton N. Petrov