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

Jim, Thanks! You helped solve the problem. The user initially reported
that sending ^c to the FE while the inferior was running would cause GDB
to shut down. 

I asked the user to try emacs, and he reported that this worked fine. 
After finding out about process-connection-type, I asked him to set 
that to nil. The user told me that emacs also causes GDB to shut down 
when sending ^c to emacs while the inferior is running.

So, now that I know what the problem is, I'll fix it on my end. However,
could this be a potential GDB bug? or is this intended functionality?
If it's thought to be a bug, I could get the latest GDB built on that
system to see the behavior.

Thanks,
Bob Rossi


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