Re: [rfc] expose gdb values to python

Daniel Jacobowitz
2008-09-25T11:47:42Z

On Thu, Sep 25, 2008 at 01:32:57AM -0300, Thiago Jung Bauermann wrote:
> My reasoning was that if a value comes from a C context (for example),
> at least at first I'd expect it to always be printed in C syntax. But
> I see your point. And I have no preference, really.
>
> So leaving current_language in valpy_str is acceptable? Then one FIXME
> can be just dropped.

IMO, yes - or else we can pass it the language somehow, later.

> Is it useful to provide a casting mechanism, to enable for instance access
> to elements from a specific type in the inheritance hierarchy?

I think so. This reminds me of another reason why length is a
peculiar concept here: GDB should (though I think does not, at
present) support "v->D::x" and "v->C::x". So v['C::x'] would make
sense, but you can't iterate over things like that. So maybe length
should be the number of direct fields? Or the number of fields + base
classes? Either way, I suggest it match what iterators do if you
support iteration.

> But I'd leave type casting to the (still to be written) patch exposing the
> type system to python.

Sure.

--
Daniel Jacobowitz
CodeSourcery