From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29614 invoked by alias); 6 Nov 2009 10:44:56 -0000 Received: (qmail 29603 invoked by uid 22791); 6 Nov 2009 10:44:55 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Nov 2009 10:44:48 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N6MJD-0001oy-E9 for gdb@sourceware.org; Fri, 06 Nov 2009 02:44:47 -0800 Message-ID: <26229834.post@talk.nabble.com> Date: Fri, 06 Nov 2009 11:07:00 -0000 From: fpga To: gdb@sourceware.org Subject: Re: controlling gdb via python's pexpect In-Reply-To: <87ocnghrqv.fsf@j228-gm.comp.glam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <26221261.post@talk.nabble.com> <4AF336E4.5000002@codeplay.com> <87ocnghrqv.fsf@j228-gm.comp.glam.ac.uk> X-IsSubscribed: yes 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/msg00063.txt.bz2 Gaius Mulley wrote: > > George Russell writes: > >> fpga wrote: >>> Can someone please give me an example of how this is done. >>> I'm afraid the documentation is not helping me. >>> Thx >>> >> Hi, >> >> I have had some success in controlling GDB (via MI) from python, using >> the subprocess module and communicating with GDB via >> pipes. (http://docs.python.org/library/subprocess.html) >> >> The main issue so far is that some applications detect when they are >> running with pipes instead of a terminal for output, and buffer >> program output by block rather than line as on a terminal, leading to >> delays in receiving program output issued via printf, for example, >> unless it is followed by an explicit fflush call. >> >> (I too would be interested in an example of using pexpect to control GDB) >> Cheers, >> George Russell > > Hi, > > for what it is worth feel free to download > http://floppsie.comp.glam.ac.uk/download/python/twingdb.tar.gz > > which was written to run two gdb's debugging a stage1 and stage2 > generation of a compiler and single step until a line number differs. > It is written in Python and uses pexpect > > The code is very alpha - but it worked well enough to find the bug I > was hunting. > > regards, > Gaius > > Hi Gaius I'd like to download this but get The requested URL /download/python/twingdb.tar.gz was not found on this server. -- View this message in context: http://old.nabble.com/controlling-gdb-via-python%27s-pexpect-tp26221261p26229834.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.