This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH RFA] Linux threads, SIGINT handling


   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]