From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12413 invoked by alias); 9 Feb 2003 15:24:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12405 invoked from network); 9 Feb 2003 15:24:20 -0000 Received: from unknown (HELO nick.uklinux.net) (194.247.48.55) by 172.16.49.205 with SMTP; 9 Feb 2003 15:24:20 -0000 Received: by nick.uklinux.net (Postfix, from userid 501) id D5B9E76037; Sun, 9 Feb 2003 15:20:49 +0000 (GMT) From: Nick Roberts Message-ID: <15942.29137.311799.710079@nick.uklinux.net> Date: Sun, 09 Feb 2003 15:24:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: gdb@sources.redhat.com Subject: GDB/MI stream separation In-Reply-To: References: <15936.19654.642542.951794@nick.uklinux.net> X-SW-Source: 2003-02/txt/msg00170.txt.bz2 Jim Blandy wrote: > ...One approach is to use GDB's 'tty' command > to have the inferior run on a different tty than GDB itself. gdb-ui > can create a separate process buffer for the inferior's I/O, call > process-tty-name to get the name of its pseudo-tty, and then pass that > to GDB's 'tty' command. I have only seen the tty command work in one direction. That is, I can send the inferior's output to another terminal/buffer easily enough but I can't seem to receive its input. I could, however, do omething like: (defun io-mode () "Major mode for io. \\{comint-mode-map}" (make-comint "io-process""/bin/cat") (setq major-mode 'io-mode) (setq mode-name "Debuggee I/O") (setq comint-input-sender 'io-sender)) (defun io-sender (proc string) (let ((gud-proc (get-buffer-process gud-comint-buffer))) (save-excursion (set-buffer (process-buffer gud-proc)) (process-send-string gud-proc string) (process-send-string gud-proc "\n")))) (gud-def gud-run (concat "-exec-run > " (process-tty-name (get-process "io-process")))) so that `>' sends the inferior's output to another buffer and process-send-string sends the inferior's input back to GDB. This would not work if the run command was passed to GDB through the GUD buffer. Stream separation might not be essential but it would be nice to do if there's an easy way. Nick