Re: [RFC][patch 2/9] export values mechanism to Python

Daniel Jacobowitz
2008-06-03T13:04:35Z

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