This is the mail archive of the
mailing list for the Archer project.
Re: Subclassing gdb.Value
- From: Tom Tromey <tromey at redhat dot com>
- To: Jim Blandy <jimb at red-bean dot com>
- Cc: archer at sourceware dot org
- Date: Sat, 07 Feb 2009 17:02:58 -0700
- Subject: Re: Subclassing gdb.Value
- References: <firstname.lastname@example.org>
- Reply-to: Tom Tromey <tromey at redhat dot com>
Jim> However, gdb.Value doesn't have Py_TPFLAGS_BASETYPE set. Could
Jim> someone give me a heads-up about what sorts of problems I'm liable to
Jim> encounter if I try to make this work?
The core expects to be able to extract a struct value from a gdb.Value.
So, you would need to create the struct value when constructing a new
Value from Python. That's the only tricky bit I can think of.
In other places I've just relied on duck typing... e.g., for the
pluggable "backtrace", some filters return objects that supply all the
frame methods. I assume that isn't enough in your case since
presumably you want the core to convert your sub-Value to a gdb value
automatically. Maybe there's some other way we could solve that.