From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1001 invoked by alias); 23 Nov 2002 23:52:27 -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 994 invoked from network); 23 Nov 2002 23:52:24 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 23 Nov 2002 23:52:24 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id gANNZC629576; Sat, 23 Nov 2002 18:35:12 -0500 To: Eli Zaretskii Cc: a2782@dis.ulpgc.es, gdb@sources.redhat.com Subject: Re: Emacs and GDB References: <200211231133.gANBXsA06590@siglo21.dis.ulpgc.es> <2950-Sat23Nov2002133546+0200-eliz@is.elta.co.il> <200211231257.gANCv5306686@siglo21.dis.ulpgc.es> <9743-Sat23Nov2002223357+0200-eliz@is.elta.co.il> From: Jim Blandy Date: Sat, 23 Nov 2002 15:52:00 -0000 In-Reply-To: <9743-Sat23Nov2002223357+0200-eliz@is.elta.co.il> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00340.txt.bz2 "Eli Zaretskii" writes: > > Date: Sat, 23 Nov 2002 12:57:05 GMT > > From: a2782@dis.ulpgc.es > > > > Any idea about how can I do this emacs-style invocation in (Kylix) C++? > > I want to execute GDB and redirect its input to the output of my > > program in C++ (in order to send commands to GDB); and its output to > > the input of my C++ program (in order to parse the information which > > GDB returns). > > Why not do what Emacs does: create a pipe for communications between > GDB and your program, then fork/exec GDB and redirect its standard > streams to the pipe using dup2/dup system calls? Actually, Emacs creates a pseudo-tty, and runs GDB there. That allows Emacs to send a SIGINT when the user types 'C-c C-c', and things like that.