如何暂停连接到远程目标gdbserver的gdb

通过以下方式连接到远程gdbserver后:

target remote server:8888 

要么

 target extended-remote server:8888 

在继续使用CTRL + c之后,暂停debugging器是不可能的。 在本地gdb会话中执行相同的PID工作。 试图debugging一个远程gdbserver连接到其他进程,如vim,例如CTRL + C也可以。

我尝试了不同的组合

 handle SIGINT stop noprint nopass 

但它没有帮助。

暂停debugging器的唯一方法是

 kill -SIGTRAP $(pgrep -f my_app) 

在远程主机上。

 $ 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.