From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21400 invoked by alias); 11 Jan 2009 22:38:09 -0000 Received: (qmail 21391 invoked by uid 22791); 11 Jan 2009 22:38:08 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Jan 2009 22:37:32 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0BMbU4n012440; Sun, 11 Jan 2009 17:37:30 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0BMbTCE018508; Sun, 11 Jan 2009 17:37:29 -0500 Received: from opsy.redhat.com (vpn-13-3.rdu.redhat.com [10.11.13.3]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0BMbSkR006001; Sun, 11 Jan 2009 17:37:29 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 110E93780F6; Sun, 11 Jan 2009 15:37:26 -0700 (MST) To: "Mathew Yeates" Cc: gdb@sourceware.org Subject: Re: capturing command output to a variable References: <7d0c05ac0901111323u61269393vcf0c2f5fb3b5b955@mail.gmail.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Sun, 11 Jan 2009 22:38:00 -0000 In-Reply-To: <7d0c05ac0901111323u61269393vcf0c2f5fb3b5b955@mail.gmail.com> (Mathew Yeates's message of "Sun\, 11 Jan 2009 13\:23\:01 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (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-01/txt/msg00052.txt.bz2 >>>>> "Mathew" == Mathew Yeates writes: Mathew> I understand that turning on logging will allow me to save command Mathew> output to a file. But what if I want to save the output in a Mathew> convenience variable?? As far as I know, with cvs gdb this can only be done with difficulty. For example, you could log the output of the command to a file, then use 'shell' to run sed on the file to turn it into a gdb command which sets the convenience variable, and then finally 'source' the result. The Python integration will make this sort of thing much simpler, though it occurs to me that we haven't done full I/O integration yet, so this example remains difficult there. (I do have most of a patch to add ui-file wrappers to Python... I guess I ought to finish that.) Tom