binutils-gdb/gdb/testsuite/gdb.server
Pedro Alves e849ea896b GDBserver: Fix ignored Ctrl-C after reconnection
This fixes the issue reported by Dmitry Antipov <dantipov@nvidia.com>
here:
  https://sourceware.org/ml/gdb/2017-10/msg00048.html

The problem is that GDBserver stops listening to Ctrl-C/interrupt
requests if you disconnect and reconnect back.

Dmitry wrote:

~~~
Currently gdbserver installs SIGIO handler just once, in
initialize_async_io() called from captured_main(), and this handler is
removed when remote_desc is closed in remote_close().  Next, when a
new instance of remote_desc is fetched from accept() and has '\003'
arrived, input_interrupt() is never called because it is not
registered as SIGIO handler.
~~~

The fix here is not remove the SIGIO handler in the first place, thus
going back to the original before-first-connection state.

(I haven't gone back to try it, but I think this was a regression
caused by commit 8b20733984 ("[GDBserver] Block and unblock SIGIO"),
which was what made remote_close remove the signal handler.)

New test included.

gdb/gdbserver/ChangeLog:
2017-11-16  Pedro Alves  <palves@redhat.com>

	* remote-utils.c (remote_close): Block SIGIO signals instead of
	uninstalling the SIGIO handler.

gdb/testsuite/ChangeLog:
2017-11-16  Pedro Alves  <palves@redhat.com>

	* gdb.server/reconnect-ctrl-c.c: New file.
	* gdb.server/reconnect-ctrl-c.exp: New file.
2017-11-16 14:58:51 +00:00
..
connect-stopped-target.c
connect-stopped-target.exp
connect-with-no-symbol-file.c
connect-with-no-symbol-file.exp
connect-without-multi-process.c
connect-without-multi-process.exp
ext-attach.c
ext-attach.exp Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restart, ext-run}.exp 2017-11-09 22:46:44 +00:00
ext-restart.exp Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restart, ext-run}.exp 2017-11-09 22:46:44 +00:00
ext-run.exp Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restart, ext-run}.exp 2017-11-09 22:46:44 +00:00
ext-wrapper.exp Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restart, ext-run}.exp 2017-11-09 22:46:44 +00:00
file-transfer.exp
no-thread-db.c
no-thread-db.exp
non-existing-program.exp
normal.c
reconnect-ctrl-c.c GDBserver: Fix ignored Ctrl-C after reconnection 2017-11-16 14:58:51 +00:00
reconnect-ctrl-c.exp GDBserver: Fix ignored Ctrl-C after reconnection 2017-11-16 14:58:51 +00:00
run-without-local-binary.exp
server-exec-info.exp
server-kill.c
server-kill.exp
server-mon.exp
server-run.exp
server.c
solib-list-lib.c
solib-list-main.c
solib-list.exp
transfer.txt
unittest.exp
wrapper.c
wrapper.exp