Re: Extending gdb.Value

Tom Tromey
2010-09-29T21:23:13Z

>>>>> "Joel" == Joel Borggrén-Franck <joel.borggren.franck@gmail.com> writes:

Joel> So I noticed today that I cant extend gdb.Value:

Joel> The fix for this is trivial:
[...]

Joel> I'm convinced this is a good idea. I got lots of stuff I would like to
Joel> add on top of gdb.Value that only makes sense in the context of
Joel> specific applications.

Joel> So how can I test that this doesn't break anything? And which other
Joel> python types are suitable for being bases. Why not add all of them?

I think the reason things are the way they are is due to a mix of
ignorance and conservatism. That is, we probably didn't think about it
early on (I know I didn't), and also we've generally tried to reduce our
exposure to "weird stuff" in case we need to make changes.

Could you elaborate on the uses to which you intend to put this?
That would be helpful.

The only thing I could think of that might be a problem here is
converting the Python subclass to a real `struct value' again. See
convert_value_from_python, in particular:

else if (PyObject_TypeCheck (obj, &value_object_type))
value = value_copy (((value_object *) obj)->value);

Tom