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 12:05:22PM -0700, PAUL GILLIAM wrote:
> On Mon, 2006-05-15 at 15:43 -0400, Bob Rossi wrote:
> > On Mon, May 15, 2006 at 03:17:14PM -0400, Daniel Jacobowitz wrote:
> > > On Mon, May 15, 2006 at 02:18:21PM -0400, Bob Rossi wrote:
> > > > 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)'.
> > > 
> > > Jim just explained this, but it may not have been clear: that is the
> > > wrong way to forward the signal.  If you are running GDB on a
> > > pseudo-tty, you need to forward the job control signal to that TTY, not
> > > to the GDB process itself.
> > > 
> > > I don't really know how to do that.  Is it by setting BRKING in
> > > termios?  There's something about TIOCSIGNAL too.  Lots of code for
> > > this in emacs.
> > 
> > I'm totally confused. I'm certainly not an expert, but sending a signal
> > can only be done to a pid using kill. What other ways are there?
> > 
> > Bob Rossi
> 
> Two things:
> 1) Yes the only way to send a signal to a *pid* is with kill.  But which
> pid?  DO NOT SEND THE SIGNAL TO GDB!  Send it to GDB's inferior.  

After thinking about this a little longer, I had 1 other question. See,
I'm going to put GDB on a PTY. However, I also put the inferior on it's
own PTY using 'set tty'.

In this scenario, how do I send the SIGINT? and to who? I can send it
directly to GDB using the kill system call with GDB's pid. I can send 
it to GDB's PTY using the 'write' system call or i can send it to the
inferior's PTY using the 'write' system call. Which is best?

> 2) Danial is not asking you to send a signal to a pty, he is asking you
> to send a signal to GDB's inferior *via* the pty, by using an ioctl
> function and suggesting that code exists in EMACS to do just that.

Thanks, I'm going to search for this, and I appreciate the suggestions
Daniel and Paul, if either of you have a link to the code, let me know.

Bob Rossi


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