After connecting to a remote gdbserver via:
target remote server:8888
or
target extended-remote server:8888
it is not possible to pause the debugger after a continue using CTRL+c. Doing the same within a local gdb session on the same PID it works. Trying to debug a remote gdbserver attached to some other process like vim for instance the CTRL+c works as well.
I tried different combinations like
handle SIGINT stop noprint nopass
but it did not help.
The only way to pause the debugger is a
kill -SIGTRAP $(pgrep -f my_app)
on the remote host.
$ gdb
target extended-remote localhost:8888
Remote debugging using localhost:8888
Reading /lib64/libdl.so.2 from remote target...
Reading /lib64/libSegFault.so from remote target...
...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
0x00007f6b26857923 in __select_nocancel () from target:/lib64/libc.so.6
(gdb) where
#0 0x00007f6b26857923 in __select_nocancel () from target:/lib64/libc.so.6
...
#9 0x00000000004497ee in main (argc=14, argv=0x7ffe8e4b0af8) at main.cpp:245
(gdb) c
Continuing.
^C^CThe target is not responding to interrupt requests.
Stop debugging it? (y or n) y
Disconnected from target.