From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26070 invoked by alias); 15 May 2006 06:55:16 -0000 Received: (qmail 26061 invoked by uid 22791); 15 May 2006 06:55:15 -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 06:55:14 +0000 Received: (qmail 1800 invoked from network); 15 May 2006 06:55:12 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 May 2006 06:55:12 -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> From: Jim Blandy Date: Mon, 15 May 2006 13:37:00 -0000 In-Reply-To: <20060513171441.GA13445@brasko.net> (Bob Rossi's message of "Sat, 13 May 2006 13:14:41 -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/msg00202.txt.bz2 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. 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...)