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


Bob Rossi <bob_rossi@cox.net> writes:
> Would you mind posting how Emacs starts up GDB both in annotate mode and
> in mi mode? Does it use a pty or pipe?
>
> Also, what does it do when ^c is read? Does it 'write' the byte to GDB's
> stdin? or does it use 'kill(gdb_pid, SIGINT)'?

The Emacs Lisp 'start-process' function, which is what the GDB mode
and other shell modes use, creates a pseudo-tty by default (when
available).  You can dynamically bind process-connection-type while
calling it to get pipes if you want.

When the process is communicating with Emacs via a pipe, Emacs sends
signals to it with 'kill'.  When the process is using a pseudo-tty,
Emacs uses an ioctl on the master side to get the effect of the user
hitting C-c, but in a way that works even if the program has changed
the tty settings.  I think at one point Emacs actually fetched the
'intr' character from the tty's settings, and stuffed that character
into the master side, letting the tty driver generate the signal.  But
you want to get the tty device involved somehow, so that the signal
will go to the tty's current process group.


(That was all so long ago...)


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