binutils-gdb/gdb/testsuite/gdb.threads
Pedro Alves 78708b7c8c GDBserver: ctrl-c after leader has exited
The target->request_interrupt callback implements the handling for
ctrl-c.  User types ctrl-c in GDB, GDB sends a \003 to the remote
target, and the remote targets stops the program with a SIGINT, just
like if the user typed ctrl-c in GDBserver's terminal.

The trouble is that using kill_lwp(signal_pid, SIGINT) sends the
SIGINT directly to the program's main thread.  If that thread has
exited already, then that kill won't do anything.

Instead, send the SIGINT to the process group, just like GDB
does (see inf-ptrace.c:inf_ptrace_stop).

gdb.threads/leader-exit.exp is extended to cover the scenario.  It
fails against GDBserver before the patch.

Tested on x86_64 Fedora 20, native and GDBserver.

gdb/gdbserver/
2014-11-12  Pedro Alves  <palves@redhat.com>

	* linux-low.c (linux_request_interrupt): Always send a SIGINT to
	the process group instead of to a specific LWP.

gdb/testsuite/
2014-11-12  Pedro Alves  <palves@redhat.com>

	* gdb.threads/leader-exit.exp: Test sending ctrl-c works after the
	leader has exited.
2014-11-12 11:30:49 +00:00
..
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
attach-into-signal.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
attach-into-signal.exp No longer pull thread list explicitly 2014-10-11 08:32:52 +08:00
attach-stopped.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
attach-stopped.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_in_thread.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_in_thread.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
break-while-running.c Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto" 2014-09-22 10:07:04 +01:00
break-while-running.exp Fix non-stop regressions caused by "breakpoints always-inserted off" changes 2014-10-02 10:08:00 +01:00
clone-new-thread-event.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
clone-new-thread-event.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
corethreads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
corethreads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
create-fail.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
create-fail.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
current-lwp-dead.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
current-lwp-dead.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dlopen-libpthread-lib.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dlopen-libpthread.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dlopen-libpthread.exp Skip dlopen-libpthread.exp in cross testing 2014-09-30 11:42:51 +08:00
execl.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
execl.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
execl1.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fork-child-threads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fork-child-threads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fork-thread-pending.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fork-thread-pending.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gcore-stale-thread.c Fix 'gcore' with exited threads 2014-08-21 20:36:20 +02:00
gcore-stale-thread.exp Fix 'gcore' with exited threads 2014-08-21 20:36:20 +02:00
gcore-thread.exp Remove useless gcore command detection 2014-08-21 11:36:59 +01:00
hand-call-in-threads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
hand-call-in-threads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ia64-sigill.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ia64-sigill.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info-threads-cur-sal-2.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info-threads-cur-sal.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info-threads-cur-sal.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interrupted-hand-call.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interrupted-hand-call.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
kill.c GDBserver crashes when killing a multi-thread process 2014-07-11 11:07:13 +01:00
kill.exp GDBserver crashes when killing a multi-thread process 2014-07-11 11:07:13 +01:00
killed.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
killed.exp after gdb_run_cmd, gdb_expect -> gdb_test_multiple/gdb_test 2014-09-12 22:16:31 +01:00
leader-exit.c GDBserver: ctrl-c after leader has exited 2014-11-12 11:30:49 +00:00
leader-exit.exp GDBserver: ctrl-c after leader has exited 2014-11-12 11:30:49 +00:00
linux-dp.c
linux-dp.exp No longer pull thread list explicitly 2014-10-11 08:32:52 +08:00
local-watch-wrong-thread.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
local-watch-wrong-thread.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
manythreads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
manythreads.exp Remove Vax Ultrix and VAX BSD support 2014-10-24 17:56:56 +01:00
multi-create.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
multi-create.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
multiple-step-overs.c Handle multiple step-overs. 2014-03-20 13:43:28 +00:00
multiple-step-overs.exp Handle multiple step-overs. 2014-03-20 13:43:28 +00:00
next-bp-other-thread.c PR 17408 - assertion failure in switch_back_to_stepped_thread 2014-10-29 18:15:39 +00:00
next-bp-other-thread.exp PR 17408 - assertion failure in switch_back_to_stepped_thread 2014-10-29 18:15:39 +00:00
no-unwaited-for-left.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
no-unwaited-for-left.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-1.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-1.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-2.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-2.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-3.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-3.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-4.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-ldr-exc-4.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pending-step.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pending-step.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
print-threads.c
print-threads.exp Remove Vax Ultrix and VAX BSD support 2014-10-24 17:56:56 +01:00
pthread_cond_wait.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pthread_cond_wait.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pthreads.c Delete Tru64 support 2014-10-17 11:18:59 +01:00
pthreads.exp Remove Vax Ultrix and VAX BSD support 2014-10-24 17:56:56 +01:00
queue-signal.c Fix set up of queue-signal.exp test. 2014-09-14 10:48:38 -07:00
queue-signal.exp New command queue-signal. 2014-09-13 21:44:00 -07:00
reconnect-signal.c [remote/gdbserver] Don't lose signals when reconnecting. 2014-01-08 18:55:51 +00:00
reconnect-signal.exp [remote/gdbserver] Don't lose signals when reconnecting. 2014-01-08 18:55:51 +00:00
schedlock.c PR 17408 - assertion failure in switch_back_to_stepped_thread 2014-10-29 18:15:39 +00:00
schedlock.exp PR 17408 - assertion failure in switch_back_to_stepped_thread 2014-10-29 18:15:39 +00:00
siginfo-threads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
siginfo-threads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
signal-command-handle-nopass.c Always pass signals to the right thread 2014-07-25 16:57:31 +01:00
signal-command-handle-nopass.exp gdb.threads/signal-command-handle-nopass.exp: Add comment 2014-07-30 12:19:30 +01:00
signal-command-multiple-signals-pending.c Always pass signals to the right thread 2014-07-25 16:57:31 +01:00
signal-command-multiple-signals-pending.exp Always pass signals to the right thread 2014-07-25 16:57:31 +01:00
signal-delivered-right-thread.c Always pass signals to the right thread 2014-07-25 16:57:31 +01:00
signal-delivered-right-thread.exp Always pass signals to the right thread 2014-07-25 16:57:31 +01:00
signal-while-stepping-over-bp-other-thread.c Further cleanup of signal-while-stepping-over-bp-other-thread.c. 2014-03-20 14:09:53 +00:00
signal-while-stepping-over-bp-other-thread.exp Make signal-while-stepping-over-bp-other-thread.exp run against remote targets too. 2014-03-20 13:44:32 +00:00
sigstep-threads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sigstep-threads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sigthread.c
sigthread.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
staticthreads.c Fix the race in gdb.threads/staticthreads.exp 2014-06-06 09:45:22 +08:00
staticthreads.exp Fix the race in gdb.threads/staticthreads.exp 2014-06-06 09:45:22 +08:00
step-over-lands-on-breakpoint.c Fix missing breakpoint/watchpoint hits, eliminate deferred_step_ptid. 2014-03-20 13:26:31 +00:00
step-over-lands-on-breakpoint.exp Fix missing breakpoint/watchpoint hits, eliminate deferred_step_ptid. 2014-03-20 13:26:31 +00:00
step-over-trips-on-watchpoint.c Fix for even more missed events; eliminate thread-hop code. 2014-03-20 13:42:23 +00:00
step-over-trips-on-watchpoint.exp Fix for even more missed events; eliminate thread-hop code. 2014-03-20 13:42:23 +00:00
stepi-random-signal.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
stepi-random-signal.exp Fix gdb.threads/stepi-random-signal.exp on software single-step targets. 2014-02-07 19:04:10 +00:00
switch-threads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
switch-threads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread-execl.c gdb.threads/thread-execl.exp: #include <stdio.h>. 2014-08-25 12:23:50 -07:00
thread-execl.exp Fix next over threaded execl with "set scheduler-locking step". 2014-06-19 11:59:03 +01:00
thread-find.exp No longer pull thread list explicitly 2014-10-11 08:32:52 +08:00
thread-specific-bp.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread-specific-bp.exp enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
thread-specific.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread-specific.exp gdb.threads/thread-specific.exp: Fix uninitialized variable references 2014-03-21 23:51:16 +00:00
thread-unwindonsignal.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread_check.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread_check.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread_events.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
thread_events.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
threadapply.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
threadapply.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
threxit-hop-specific.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
threxit-hop-specific.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls-main.c
tls-nodebug.c gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads. 2013-07-18 15:49:22 +00:00
tls-nodebug.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls-shared.c gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads. 2013-07-18 15:49:22 +00:00
tls-shared.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls-var-main.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls-var.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls-var.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls.c
tls.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tls2.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork-child.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork-mt.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork-parent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork-st.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchpoint-fork.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads-reorder.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads-reorder.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads2.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watchthreads2.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
wp-replication.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
wp-replication.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00