This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] expose gdb values to python
- From: Daniel Jacobowitz <drow at false dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Thiago Jung Bauermann <bauerman at br dot ibm dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Sat, 4 Oct 2008 18:20:55 -0400
- Subject: Re: [rfc] expose gdb values to python
- References: <1221199426.24580.26.camel@localhost.localdomain> <m3skrv92wf.fsf@fleche.redhat.com> <20081001054741.GE3665@adacore.com> <m3ljx8l5cf.fsf@fleche.redhat.com>
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