This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] Linux threads, SIGINT handling
- To: msnyder at cygnus dot com
- Subject: Re: [PATCH RFA] Linux threads, SIGINT handling
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Sat, 26 May 2001 10:07:18 +0200
- CC: gdb-patches at sources dot redhat dot com
- References: <3B0EB00D.6F856A32@cygnus.com>
Date: Fri, 25 May 2001 12:18:37 -0700
From: Michael Snyder <msnyder@cygnus.com>
Mark,
When a user types ^C(break) at a tty on Linux, SIGINT is sent to every
thread in the process group (whether by the kernel or by the manager
thread, I do not know). The effect is that, if you type ^C once, you
have to say "continue" N times (once for every user thread).
It's the kernel that sends all those SIGINTs, since to the kernel our
program is just a bunch of processes sharing their VM. And indeed,
the effect is rather annoying.
This patch handles that problem by discarding the redundant SIGINT
events (ie. all of them except the one that was actually detected in
lin_lwp_wait).
I don't think it's OK to unconditionally discard the SIGINT events.
The process might want to do something special with those, and may
depend on getting them in every thread. How about changing the
else if (WSTOPSIG (status) == SIGINT)
into
else if (WSTOPSIG (status) == SIGINT
&& signal_pass_state (SIGINT) == 0)
? Not passing SIGINT to the inferior is GDB's default, so this will
work fine for most people. And this way people can say
"handle SIGINT pass"
ignore the warning, and have SIGINT delivered to all threads.
If you agree, it's OK to check this in with that change.
Mark