old-cross-binutils/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
..
attach-into-signal.c
attach-into-signal.exp No longer pull thread list explicitly 2014-10-11 08:32:52 +08:00
attach-stopped.c
attach-stopped.exp
bp_in_thread.c
bp_in_thread.exp
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
clone-new-thread-event.exp
corethreads.c
corethreads.exp
create-fail.c
create-fail.exp
current-lwp-dead.c
current-lwp-dead.exp
dlopen-libpthread-lib.c
dlopen-libpthread.c
dlopen-libpthread.exp Skip dlopen-libpthread.exp in cross testing 2014-09-30 11:42:51 +08:00
execl.c
execl.exp
execl1.c
fork-child-threads.c
fork-child-threads.exp
fork-thread-pending.c
fork-thread-pending.exp
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
hand-call-in-threads.exp
ia64-sigill.c
ia64-sigill.exp
info-threads-cur-sal-2.c
info-threads-cur-sal.c
info-threads-cur-sal.exp
interrupted-hand-call.c
interrupted-hand-call.exp
kill.c
kill.exp
killed.c
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
local-watch-wrong-thread.exp
Makefile.in
manythreads.c
manythreads.exp Remove Vax Ultrix and VAX BSD support 2014-10-24 17:56:56 +01:00
multi-create.c
multi-create.exp
multiple-step-overs.c
multiple-step-overs.exp
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
no-unwaited-for-left.exp
non-ldr-exc-1.c
non-ldr-exc-1.exp
non-ldr-exc-2.c
non-ldr-exc-2.exp
non-ldr-exc-3.c
non-ldr-exc-3.exp
non-ldr-exc-4.c
non-ldr-exc-4.exp
pending-step.c
pending-step.exp
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
pthread_cond_wait.exp
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
reconnect-signal.exp
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
siginfo-threads.exp
signal-command-handle-nopass.c
signal-command-handle-nopass.exp
signal-command-multiple-signals-pending.c
signal-command-multiple-signals-pending.exp
signal-delivered-right-thread.c
signal-delivered-right-thread.exp
signal-while-stepping-over-bp-other-thread.c
signal-while-stepping-over-bp-other-thread.exp
sigstep-threads.c
sigstep-threads.exp
sigthread.c
sigthread.exp
staticthreads.c
staticthreads.exp
step-over-lands-on-breakpoint.c
step-over-lands-on-breakpoint.exp
step-over-trips-on-watchpoint.c
step-over-trips-on-watchpoint.exp
stepi-random-signal.c
stepi-random-signal.exp
switch-threads.c
switch-threads.exp
thread-execl.c gdb.threads/thread-execl.exp: #include <stdio.h>. 2014-08-25 12:23:50 -07:00
thread-execl.exp
thread-find.exp No longer pull thread list explicitly 2014-10-11 08:32:52 +08:00
thread-specific-bp.c
thread-specific-bp.exp
thread-specific.c
thread-specific.exp
thread-unwindonsignal.exp
thread_check.c
thread_check.exp
thread_events.c
thread_events.exp
threadapply.c
threadapply.exp
threxit-hop-specific.c
threxit-hop-specific.exp
tls-main.c
tls-nodebug.c
tls-nodebug.exp
tls-shared.c
tls-shared.exp
tls-var-main.c
tls-var.c
tls-var.exp
tls.c
tls.exp
tls2.c
watchpoint-fork-child.c
watchpoint-fork-mt.c
watchpoint-fork-parent.c
watchpoint-fork-st.c
watchpoint-fork.exp
watchpoint-fork.h
watchthreads-reorder.c
watchthreads-reorder.exp
watchthreads.c
watchthreads.exp
watchthreads2.c
watchthreads2.exp
wp-replication.c
wp-replication.exp