9

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.
christner
  • 671
  • 6
  • 10
msssm
  • 351
  • 1
  • 2
  • 10
  • 1
    This is an old post, but I got same trouble today, the problem still exists in the latest *gdb* source code. `SIGTRAP` is a workaround, the code patch can be found at: https://sourceware.org/bugzilla/show_bug.cgi?id=18772, and steps to build gdb: https://stackoverflow.com/questions/60973768/build-gdbserver-for-android-aarch64 – aj3423 Apr 11 '20 at 17:38
  • I had the same issue, could not interrupt the running target from GDB. The patch referenced by @aj3423 fixed my issue, thank you :) – aallrd Apr 22 '20 at 15:24

0 Answers0