From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11801 invoked by alias); 7 Apr 2009 12:46:18 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 11790 invoked by uid 22791); 7 Apr 2009 12:46:17 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_JMF_BL X-Spam-Check-By: sourceware.org Message-Id: From: Ray Ruvinskiy To: archer@sourceware.org In-Reply-To: Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: A few python/pretty-printing questions Date: Tue, 07 Apr 2009 12:46:00 -0000 References: <5961E381-9F09-4ADE-80DE-9BCCB02E802B@sybase.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes X-SW-Source: 2009-q2/txt/msg00024.txt.bz2 Thank you both for your replies. Ray On 6-Apr-09, at 5:57 PM, Tom Tromey wrote: >>>>>> "Ray" == Ray Ruvinskiy writes: > > Ray> - Can pretty-printers be toggled on a case-by-case basis? If I > have a > Ray> printer enabled for a certain type, can I still look at the raw > Ray> structure? > > Yes, "print /r value". Here, "r" means "raw". > > Ray> - Is it possible to export convenience variables from within the > Ray> python layer so that they would be visible from the gdb prompt? > > We don't have an API for this, but I suppose we could add one. > > Ray> - Suppose I want to pass an expression of the form > Ray> 'this->inner1.inner2.leaf' to a python command, is there a quick > Ray> way to look up the gdb.Value corresponding to the name, or do I > Ray> have to first look up 'this' and then index into the dictionary? > > You can use the function gdb.parse_and_eval to parse an expression, > evaluate it, and yield a Value. We'll probably change the name of > this function, AFAIK none of us particularly likes this name :) > > Tom >