Decouple target_interrupt from all-stop/non-stop modes

In non-stop mode, "interrupt" results in a "stop with no signal",
while in all-stop mode, it results in a remote interrupt request /
stop with SIGINT.  This is currently implemented in both the Linux and
remote target backends.  Move it to the core code instead, making
target_interrupt specifically always about "Interrupting as if with
Ctrl-C", just like it is documented.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* infcmd.c (interrupt_target_1): Call target_stop is in non-stop
	mode.
	* linux-nat.c (linux_nat_interrupt): Delete.
	(linux_nat_add_target): Don't install linux_nat_interrupt.
	* remote.c (remote_interrupt_ns): Change return type to void.
	Throw error if interrupting the target is not supported.
	(remote_interrupt): Don't call the remote_stop_ns/remote_stop_as.
This commit is contained in:
Pedro Alves
2016-04-12 16:49:31 +01:00
parent a149683b0c
commit e42de8c7f8
4 changed files with 24 additions and 37 deletions

View File

@@ -3013,7 +3013,11 @@ interrupt_target_1 (int all_threads)
ptid = minus_one_ptid;
else
ptid = inferior_ptid;
target_interrupt (ptid);
if (non_stop)
target_stop (ptid);
else
target_interrupt (ptid);
/* Tag the thread as having been explicitly requested to stop, so
other parts of gdb know not to resume this thread automatically,