Re: [rfc] expose gdb values to python

Daniel Jacobowitz
2008-10-04T22:21:37Z

On Wed, Oct 01, 2008 at 09:09:36AM -0600, Tom Tromey wrote:
> Joel> Better yet, I would love for the object to have one attribute
> Joel> for each component that I could simply access using X.baz.
> Joel> But I suspect that there is no way we can implement that without
> Joel> having to compute the value of each component, which would be
> Joel> quite wastful the vast majority of the time. Sigh, is it not
> Joel> possible to lazy-initialize attributes?
>
> I think we can do this, but there is a cost, namely conflicts between
> methods on Value and field names in the inferior will have to be
> resolved in favor of the method. So, robust programs will always have
> to use the [] syntax anyway.

WDYT about making this work anyway - and using a documented namespace
for any methods we add? Then the common case will be able to use the
attributes safely.

--
Daniel Jacobowitz
CodeSourcery