How to send CTRL+C to process when debugging

Answered
I am debugging and want to send the a CTRL+C to the process being debugged. I want to debug the behavior when receiving a SIGINT.

It seems CTRL+key sequences are filtered by the IDE and not send to the process.

Is there another way?
8
7 comments

Having the same problem... 

Could anyone answer this question please?

0

Hi,

If you hover your mouse over the Stop button, you will see the tooltip with a shortcut. You can then go to settings --> Keymap and find this action by shortcut and customozise as you wish.

-1

In CLion 2019.2, at least, the debugger's Stop button doesn't send a SIGINT, it sends a SIGKILL (I think - its not SIGINT anyway). However in the Run state, the Stop button does send a SIGINT. I haven't been able to find a way to send a SIGINT to the debugged process from within CLion.

0

in new version like goland , you can send ctrl+c to debugger console to send sig

0

> you can send ctrl+c to debugger console to send sig

Unfortunately this doesn't seem to work (yet?) in CLion 2020.2.

0

In CLion 2021.2.2, I am able to send SIGINT (Ctrl+C) to the debug target with this sequence:

1. Pause program being debugged
2. Switch to GDB Console
3. Send the SIGINT signal with the GDB command 'signal 2'

Output from GDB looks like this:

(gdb) signal 2
Continuing with signal SIGINT.

The program will resume from the point it was paused and the Ctrl+C signal is then processed.

6

For me `signal 2` did not work, I had to do,

(gdb) signal.raise_signal(2)
0

Please sign in to leave a comment.