This is the mail archive of the gdb-prs@sourceware.org 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]
Other format: [Raw text]

Re: threads/2320: When using "sigwait" GDB doesn't trap SIGINT.Ctrl+C terminates program when should break gdb.


The following reply was made to PR threads/2320; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: jordiblasi@gmail.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: threads/2320: When using "sigwait" GDB doesn't trap SIGINT.
	Ctrl+C terminates program when should break gdb.
Date: Sat, 29 Sep 2007 16:32:44 -0400

 On Thu, Sep 20, 2007 at 08:53:13AM -0000, jordiblasi@gmail.com wrote:
 > I'm having problems getting GDB to not pass SIGINT to my program. In
 > my main thread I do a sigwait for SIGINT. When I'm debugging, while
 > gdb is running I may want to break gdb to set breakpoints or so,
 > then I hit Ctrl-C (send SIGINT) but gdb does not break, instead
 > SIGINT is passed to my program that gracefully terminates and gdb
 > prints "Program exited normally".
 
 Thanks for the clear report and test case.  I discussed this with
 Roland McGrath in the bugzilla.kernel.org entry you linked to; our
 conclusion was that the kernel is correct to not report the SIGINT
 in this case.  Of course that's not the useful behavior for GDB.
 
 I'm not planning to work on this right now, but here's some notes
 on a possible solution if anyone else wants to.
 
   - Define a new PTRACE_SETOPTIONS bit to enable the extra reporting.
 
   - Report the signal as a special event, using a new PTRACE_EVENT_FOO
     code in the high half-word of the wait status.
 
   - Adjust GDB to set the new options bit when it sets other options.
 
 -- 
 Daniel Jacobowitz
 CodeSourcery


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