From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23181 invoked by alias); 9 Oct 2005 12:33:49 -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 23158 invoked by uid 22791); 9 Oct 2005 12:33:45 -0000 Received: from eastrmmtao03.cox.net (HELO eastrmmtao03.cox.net) (68.230.240.36) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 09 Oct 2005 12:33:45 +0000 Received: from white ([68.9.64.121]) by eastrmmtao03.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051009123327.NZJE2767.eastrmmtao03.cox.net@white>; Sun, 9 Oct 2005 08:33:27 -0400 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EOaMo-00008B-00; Sun, 09 Oct 2005 08:33:26 -0400 Date: Sun, 09 Oct 2005 12:33:00 -0000 From: Bob Rossi To: "jingzhao.ou" Cc: gdb@sources.redhat.com Subject: Re: Separating "shell dir" output from GDB/MI output Message-ID: <20051009123326.GA436@white> Mail-Followup-To: "jingzhao.ou" , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-SW-Source: 2005-10/txt/msg00050.txt.bz2 On Sat, Oct 08, 2005 at 10:19:33PM -0700, jingzhao.ou wrote: > Dear all, > > I am trying to see if it is possible to build a Tcl/Tk based GDB > frontend using Bob Rossi's MI parser. For normal commands, it works > just fine. However, if I execute "shell dir" command in gdb, the > parser will report error. (see the end of the email) > > I am wondering if there is any way to separate the shell output from > the normal GDB output. So that this problem can be solved properly. > > Sincerely hope that any one can give me a hand. I am using MinGW. > > Best regards, > Jingzhao > > =========================================== > (gdb) > &"shell dir\n" > Makefile gdbmi_grammar.tab.o gdbmi_pt.c main.tcl > Makefile_orig gdbmi_grammar.txt gdbmi_pt.h tkGDB.c > b gdbmi_grammar.y gdbmi_pt.o tkGDB.dll > bb gdbmi_lexer.l lex.yy.c tkGDB.exe > gdbmi_driver.c gdbmi_parser.c lex.yy.o tkGDB_bak.c > gdbmi_grammar.tab.c gdbmi_parser.h libgdbmi_parser.a tkGDB_stub.c > gdbmi_grammar.tab.h gdbmi_parser.o main.exe tk_gdb.tcl > ^done > (gdb) > =========================================== I think the best idea we've had so far for solving problems like this is to add an option to GDB to have it output GDB/MI data on a file descriptor X. For instance, gdb -i=mi -mi-out-fd=30 and then when you fork/exec GDB you dup the 30 file descriptor so that you can read the output. Eli, do you know if this approach would be portable to windows nativly? I could look into implementing this feature, since it would resolve a *lot* of problems regarding I/O. Thanks, Bob Rossi