From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30801 invoked by alias); 26 Nov 2009 17:16:27 -0000 Received: (qmail 30792 invoked by uid 22791); 26 Nov 2009 17:16:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mta3.glam.ac.uk (HELO mta3.glam.ac.uk) (193.63.147.53) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Nov 2009 17:16:23 +0000 Received: from j228-gm.comp.glam.ac.uk ([193.63.148.84] helo=j228-gm) by mta3.glam.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1NDhx6-0005ls-DM; Thu, 26 Nov 2009 17:16:20 +0000 Received: from gaius by j228-gm with local (Exim 4.69) (envelope-from ) id 1NDhwa-00030U-O5; Thu, 26 Nov 2009 17:15:48 +0000 To: fpga Cc: gdb@sourceware.org Subject: Re: pexpect doesnt seem able to control bochs like it does gdb??? References: <26531395.post@talk.nabble.com> From: Gaius Mulley Date: Thu, 26 Nov 2009 21:35:00 -0000 In-Reply-To: <26531395.post@talk.nabble.com> (fpga's message of "Thu\, 26 Nov 2009 07\:54\:48 -0800 \(PST\)") Message-ID: <871vjljjgb.fsf@j228-gm.comp.glam.ac.uk> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00196.txt.bz2 fpga writes: > I've been controlling qemu with gdb via pexpect. > I'm now trying to control bochs debugger with pexpect > [code] > #!/usr/bin/python > import pexpect, subprocess, time > child = pexpect.spawn('terminator -x bochs\n') > child.expect_exact ('Please choose one: [6] ') > child.send ('6\n') > [/code] > > Unfortunately bochs debugger ignores the 6 that is sent. > I just wonder if anyone knows how to get around such "ignorance". > If it's any help... > I note that if I If I press 6 then this works > i.e. it's as if I had inserted 'child.interact()' before sending the 6??? > Any advice much appreciated Hi, I could be very wrong - but it might be worth seeing if changing the code > child.send ('6\n') to child.sendline('6') helps.. regards, Gaius