This is the mail archive of the
mailing list for the Archer project.
Re: A few python/pretty-printing questions
- From: Tom Tromey <tromey at redhat dot com>
- To: Ray Ruvinskiy <rruvinsk at sybase dot com>
- Cc: archer at sourceware dot org
- Date: Mon, 06 Apr 2009 15:57:47 -0600
- Subject: Re: A few python/pretty-printing questions
- References: <5961E381-9F09-4ADE-80DE-9BCCB02E802B@sybase.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Ray" == Ray Ruvinskiy <email@example.com> 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
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 :)