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:
> 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?

I think if you switch from a pty to a pipe, there will be lots of
different changes in the behavior of the subprocess.  You might get
behavior like what your front end shows, but you might not even get
that far.  Or there might be other confusing things going on.

You could put

(setq process-connection-type nil)

in your .emacs file.  But only use this for testing!  Take it out when
you're done.  process-connection-type is meant to be used in
combination with Emacs Lisp's dynamic binding; if you just whack its
value globally you'll get all sorts of wierd behavior from anything
that tries to run a subprocess from a pty.

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

If you're not familiar with how job control works, and how it
interacts with tty devices, you should definitely read up on that.  If
you're not interacting with the tty in a way that plays nicely with
GDB's tty management code, then you'll have all sorts of problems like
this.


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