Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* "The target is not responding to interrupt requests" after re-attach
@ 2017-10-17 14:04 Dmitry Antipov
  2017-10-19 11:39 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Antipov @ 2017-10-17 14:04 UTC (permalink / raw)
  To: GDB Development

I'm trying a "remote" (both gdb and gdbsever are on the same GNU/Linux x86_64 target)
debugging of the following program:

#include <time.h>

int
main (int argc, char *argv[])
{
   struct timespec ts = { .tv_sec = 1, .tv_nsec = 0 };
   while (1)
     nanosleep (&ts, NULL);
   return 0;
}

with 'gdbserver --attach :8888 [PID]' and 'extended-remote' target.
During first debugging session, Ctrl-C works as expected, for example:

$ gdb -q
(gdb) set sysroot /
(gdb) target extended-remote :8888
Remote debugging using :8888
Reading symbols from /tmp/t-nanosleep...done.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6
(gdb) q
A debugging session is active.

	Inferior 1 [process 9320] will be detached.

Quit anyway? (y or n) y
Detaching from program: /tmp/t-nanosleep, process 9320

But it doesn't work for the next time:

$ gdb -q
(gdb) set sysroot /
(gdb) target extended-remote :8888
Remote debugging using :8888
(gdb) attach 9320
Attaching to process 9320
Reading symbols from /tmp/t-nanosleep...done.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6
(gdb) c
Continuing.
^C
^CThe target is not responding to interrupt requests.
Stop debugging it? (y or n) y

Even if it works as expected, what are the reasons for being inconsistent here?

Dmitry


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-19 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 14:04 "The target is not responding to interrupt requests" after re-attach Dmitry Antipov
2017-10-19 11:39 ` Pedro Alves
2017-10-19 11:57   ` Dmitry Antipov
2017-10-19 13:21     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox