Search code examples
c++signalskdevelop

Howto send signals to a program started in Debug mode in KDevelop


I want to analyse a program that i've written in KDevelop. I compile the Program and start it with

Right Click on the CMake Project -> Debug as... -> Native Application

Now the program runs in KDevelop and I can see the output on the console embedded into KDevelop. My program stops running when I press Ctrl+C" (SIGTERM). I can press it when I'm running the program in a console outside KDevelop.

How can I send the signal "SIGTERM" to the embedded console inside KDevelop?

As a workaround I can start htop, select the program and send a SIGTERM from there, which works fine although it would be nicer to have all the functionality in KDevelop itself.


Solution

  • One possible Solution is:

    • Right Click on the CMake Project -> Debug as... -> Native Application.
    • Change to the "gdb"-Tab inside KDevelop.
    • Hit the "Pause"-Icon on the right corner to enable the input field of the "gdb"-Tab
    • Type signal <Signal>, e.g. signal SIGTERM
    • The program continues and it catches the signal sent.