This is the mail archive of the gdb@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: invoking GDB from FE and signals


On Mon, May 15, 2006 at 10:07:51AM -0700, PAUL GILLIAM wrote:
> On Sat, 2006-05-13 at 11:48 -0400, Daniel Jacobowitz wrote:
> > On Sat, May 13, 2006 at 11:20:21AM -0400, Bob Rossi wrote:
> > > When I say "the supported way", I'm assuming there is a way GDB provides
> > > for FE's to work with it in regards to sending signals, in particularly
> > > ^c.
> > 
> > But there isn't :-)
> > 
> > > If GDB doesn't provide this functionality and it's mere hackers
> > > chance that all of us FE's are getting this to work most of the time,
> > > then I understand what you mean.
> > > 
> > > Othewise, if GDB has been designed to accept signal during certain
> > > circumstances, and not during others, I would love to know what those
> > > are so that I can benefit from using this functionality.
> > 
> > If there were such a design, hopefully, it would be in the manual.  All
> > of this is generally legacy from the GDB CLI, which is designed to work
> > with the host's job control.  When the inferior is running and you
> > press Control-C, the signal goes to the inferior, not to GDB.
> > 
> > Your needs may be different.
> 
> Just to add a little detail about the 'normal' case:  You press
> <cntl-c>, the tty handler intercepts it and sends a signal to the
> inferior.  Because the inferior is being debugged, *any* signal causes
> it to stop, letting the debugger know that it stopped due to a
> particular signal.  When gdb causes the inferior to run again, gdb
> decides if the signal should be 'passed through' to the inferior'.
> 
> I hope I'm not being pedantic.

OK, here's what happens from the FE perspective though. You type ^c. The
FE get's the signal (which is in a different process group than GDB),
and passes the signal to GDB with 'kill (gdb_pid, SIGINT)'.

Even though the inferior is running, GDB is getting the signal. What
happens from this point? Also, the 2 interesting case's might be when
the inferior is on the same PTY as GDB and on a different PTY.

Thanks,
Bob Rossi


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