From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16952 invoked by alias); 4 Nov 2009 20:15:34 -0000 Received: (qmail 16941 invoked by uid 22791); 4 Nov 2009 20:15:33 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Nov 2009 20:15:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4D319200C1B; Wed, 4 Nov 2009 15:15:28 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id E1isZWJhUjQK; Wed, 4 Nov 2009 15:15:28 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E829E200C08; Wed, 4 Nov 2009 15:15:27 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id C4341F5905; Wed, 4 Nov 2009 12:15:19 -0800 (PST) Date: Wed, 04 Nov 2009 20:15:00 -0000 From: Joel Brobecker To: S?rgio Durigan J?nior Cc: Marco Menegazzi , gdb@sourceware.org Subject: Re: GDB GUI Message-ID: <20091104201519.GY4573@adacore.com> References: <100F84AB-4BCE-427F-9796-3D2162D97DC9@gmail.com> <200911021436.46359.sergiodj@linux.vnet.ibm.com> <0F6AD058-C87F-4E6E-9CA2-0B7F2342AD5E@gmail.com> <200911041446.34726.sergiodj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911041446.34726.sergiodj@linux.vnet.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00040.txt.bz2 > On Wednesday 04 November 2009, Marco Menegazzi wrote: > > I've already seen that documentation but my problem is that it does > > not explain how to connect to this interface through code. It explains > > how it is but not how to use it ... I want to connect through my java > > code but the only idea I have is to call it directly from the code > > with Runtime.exec ... but then I ask myself why to use gdb/mi that > > returns a more complex output instead of calling directly gdb and > > parse the stout to get what I want? What we do in AdaCore's IDE is to create a pseudo-tty, and launch the debugger using that pseudo-tty. That way, GDB thinks it is in a terminal, and we get to send commands and receive their output. I believe that this is also what tools such as "expect" do. The code we used was originally taken from the emacs sources, so you might be able to find some C code that does just that. Or perhaps Java has some library classes that do that for you. -- Joel