From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: msnyder@cygnus.com Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH RFA] Linux threads, SIGINT handling Date: Sat, 26 May 2001 01:07:00 -0000 Message-id: <200105260807.f4Q87Id00253@delius.kettenis.local> References: <3B0EB00D.6F856A32@cygnus.com> X-SW-Source: 2001-05/msg00474.html Date: Fri, 25 May 2001 12:18:37 -0700 From: Michael Snyder 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