From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28725 invoked by alias); 16 Nov 2009 17:55:31 -0000 Received: (qmail 28716 invoked by uid 22791); 16 Nov 2009 17:55:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Nov 2009 17:54:27 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAGHsOWt007577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Nov 2009 12:54:24 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAGHsN5u024601; Mon, 16 Nov 2009 12:54:23 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id nAGHsMLa015948; Mon, 16 Nov 2009 12:54:23 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 68E6B37830D; Mon, 16 Nov 2009 10:54:22 -0700 (MST) From: Tom Tromey To: scott snyder Cc: Arjun Roy , gdb@sourceware.org Subject: Re: Python Scripting Question References: <4AF63479.7010602@gmail.com> <4AF87557.8020701@stanford.edu> <200911122053.nACKrgkk023638@d0mino02.fnal.gov> Reply-To: Tom Tromey Date: Wed, 18 Nov 2009 20:43:00 -0000 In-Reply-To: <200911122053.nACKrgkk023638@d0mino02.fnal.gov> (scott snyder's message of "Thu, 12 Nov 2009 14:53:42 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00157.txt.bz2 >>>>> "scott" == scott snyder writes: scott> FWIW, i've been using this patch. This adds a function scott> `gdb.execute_getoutput', which returns the output as a string. scott> This probably isn't really the right way to do this --- scott> I don't think this does the right thing with MI, and it has an ugly scott> special case for TUI, but it's been working for me so far. This looks reasonable. However, I was planning to do it in a different way. In particular what I've been thinking is that we'd have a way to let the user pass any pythonic output stream to gdb; either with explicit commands to override the current output stream, or as an argument to gdb.execute. Handling MI-like output would work in a similar way, just with a way to indicate that the new output stream is MI-like. What do you think? If that is too vague I can try to write up something more documentation-like. scott> + if (uiout == tui_out) scott> + uiout = tui_old_uiout; This sort of redirection probably belongs in a helper function in ui-out. scott> + /* Do any commands attached to breakpoint we stopped at. */ scott> + bpstat_do_actions (); This could produce output. Arguably it should be redirected as well. Tom