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 Sun, May 14, 2006 at 11:55:10PM -0700, Jim Blandy wrote:
> 
> 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.

Hey Jim, thanks for the info! The user that's having the problem with my
FE states that emacs works fine. So, are you suggesting I could have him
put some configuration line with regards to 'process-connection-type' to
get emacs to use a pipe instead of a pty? If so, it would be perfect to
see emacs also produce the same bug that my FE is producing. Do you know
the exact line that he could add to a particular file in order to get
emacs working like this?

> 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...)

Wow, this information is amazingly helpful. I do the same solution emacs
is doing with regards to pipe's. I used to actually do the pty solution.
I'm considering adding an option also, to allow using both solutions.

Thanks,
Bob Rossi


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