From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14895 invoked by alias); 29 Sep 2010 21:23:13 -0000 Received: (qmail 14884 invoked by uid 22791); 29 Sep 2010 21:23:12 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Sep 2010 21:23:06 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8TLN4uK011659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 29 Sep 2010 17:23:04 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8TLN3qT008900; Wed, 29 Sep 2010 17:23:03 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o8TLN3HI020012; Wed, 29 Sep 2010 17:23:03 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id BB15D3799D4; Wed, 29 Sep 2010 15:23:02 -0600 (MDT) From: Tom Tromey To: Joel =?utf-8?Q?Borggr=C3=A9n-Franck?= Cc: gdb@sourceware.org Subject: Re: Extending gdb.Value References: Date: Wed, 29 Sep 2010 21:23:00 -0000 In-Reply-To: ("Joel =?utf-8?Q?Borggr=C3=A9n-Franck=22's?= message of "Wed, 29 Sep 2010 17:18:10 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00158.txt.bz2 >>>>> "Joel" =3D=3D Joel Borggr=C3=A9n-Franck 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 =3D value_copy (((value_object *) obj)->value); Tom