From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9919 invoked by alias); 15 May 2006 18:41:24 -0000 Received: (qmail 9908 invoked by uid 22791); 15 May 2006 18:41:23 -0000 X-Spam-Check-By: sourceware.org Received: from intranet.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 15 May 2006 18:41:22 +0000 Received: (qmail 19755 invoked from network); 15 May 2006 18:41:20 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 May 2006 18:41:20 -0000 To: Bob Rossi Cc: gdb@sourceware.org, Nick Roberts Subject: Re: invoking GDB from FE and signals References: <20060513141920.GC10678@brasko.net> <20060513145421.GA3664@nevyn.them.org> <20060513151026.GD10678@brasko.net> <20060513151057.GA4112@nevyn.them.org> <20060513152021.GE10678@brasko.net> <20060513154816.GA5022@nevyn.them.org> <20060513171441.GA13445@brasko.net> <20060515134010.GG13445@brasko.net> From: Jim Blandy Date: Mon, 15 May 2006 18:50:00 -0000 In-Reply-To: <20060515134010.GG13445@brasko.net> (Bob Rossi's message of "Mon, 15 May 2006 09:40:10 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00211.txt.bz2 Bob Rossi writes: > On Sun, May 14, 2006 at 11:55:10PM -0700, Jim Blandy wrote: >> >> Bob Rossi 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.