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 04:05:47PM -0400, Daniel Jacobowitz wrote:
> On Mon, May 15, 2006 at 03:43:14PM -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?
> 
> Read it again :-)
> 
> You don't want to send the signal to a specific process.  You want to
> cause the pseudo-terminal to signal the correct process group.
> 
> (Also, process group != pid; you can kill negative pids, see a POSIX
> reference).

OK, here's the problem. There are 2 case's, using a PTY or not.

I am currently not using a PTY. So, I send the signal via kill. Is this
correct or incorrect?

If I use a PTY, which I'm going to have to reimplement. I'll except
signals like SIGINT, cause I'll forward them with 'write' to the PTY
between GDB and CGDB. 

I think this was Jim's idea of how Emacs works, and it's what I would
think would be best.

Bob Rossi


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