This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][patch 2/9] export values mechanism to Python
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 3 Jun 2008 09:04:12 -0400
- Subject: Re: [RFC][patch 2/9] export values mechanism to Python
- References: <20080429155212.444237503@br.ibm.com> <20080429155304.466637516@br.ibm.com> <20080528212451.GB2969@caradoc.them.org> <m3k5h78j64.fsf@fleche.redhat.com>
On Mon, Jun 02, 2008 at 06:18:59PM -0600, Tom Tromey wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
>
> Daniel> Would it be helpful or confusing to automatically expose this
> Daniel> as [] in Python, __getitem__?
>
> Good question.
>
> In general I've been using explicit method names, like get_* and
> set_*. But perhaps we should be using attributes and various
> "intrinsic" names... I'm not enough of a Python expert to know what is
> preferred.
Anyone else got a preference?
> Also, about the varobj patch in particular: I notice that it is
> MI-specific. At least for type visualizers I think I would like
> something that works with 'print' as well. I'm thinking:
>
> * A way to register a type->object mapping from Python
I'm not sure what you mean. Type to what object?
An interesting question is how to access sub-pieces of a value from
the CLI. If we pretty-print something as a map, how should the user
get (A) the values, and (B) the fields of the raw representation of
the map?
I think we need a UI before we worry about the innards.
--
Daniel Jacobowitz
CodeSourcery