From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16894 invoked by alias); 5 Nov 2009 20:35:01 -0000 Received: (qmail 16884 invoked by uid 22791); 5 Nov 2009 20:35:01 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_05,SPF_PASS X-Spam-Check-By: sourceware.org Received: from port-185.xxx.th.newnet.co.uk (HELO mail.codeplay.com) (80.175.148.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Nov 2009 20:34:56 +0000 Received: from [192.168.1.66] (c-1769e155.77-6-64736c14.cust.bredbandsbolaget.se [85.225.105.23]) (authenticated bits=0) by mail.codeplay.com (8.14.3/8.14.3/Debian-6) with ESMTP id nA5KYoWU011856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 5 Nov 2009 20:34:53 GMT Message-ID: <4AF336E4.5000002@codeplay.com> Date: Thu, 05 Nov 2009 20:35:00 -0000 From: George Russell User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: fpga CC: gdb@sourceware.org Subject: Re: controlling gdb via python's pexpect References: <26221261.post@talk.nabble.com> In-Reply-To: <26221261.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00049.txt.bz2 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