From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8242 invoked by alias); 29 Sep 2010 15:18:20 -0000 Received: (qmail 8225 invoked by uid 22791); 29 Sep 2010 15:18:18 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Sep 2010 15:18:12 +0000 Received: by qwb8 with SMTP id 8so556089qwb.0 for ; Wed, 29 Sep 2010 08:18:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.46.5 with SMTP id h5mr1255038qaf.316.1285773490376; Wed, 29 Sep 2010 08:18:10 -0700 (PDT) Received: by 10.229.19.19 with HTTP; Wed, 29 Sep 2010 08:18:10 -0700 (PDT) In-Reply-To: References: Date: Wed, 29 Sep 2010 15:18:00 -0000 Message-ID: Subject: Re: Extending gdb.Value From: =?ISO-8859-1?Q?Joel_Borggr=E9n=2DFranck?= To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00154.txt.bz2 On Fri, Sep 24, 2010 at 9:28 AM, Joel Borggr=E9n-Franck wrote: > So I noticed today that I cant extend gdb.Value: > The fix for this is trivial: --- gdb-7.2-orig/gdb/python/py-value.c 2010-06-28 23:16:03.000000000 +0200 +++ gdb-7.2/gdb/python/py-value.c 2010-09-29 13:33:00.000000000 +0200 @@ -1156,7 +1156,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | Py_TPFLAGS_BASETYPE, /*tp_flags*/ "GDB value object", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ I'm convinced this is a good idea. I got lots of stuff I would like to add on top of gdb.Value that only makes sense in the context of specific applications. So how can I test that this doesn't break anything? And which other python types are suitable for being bases. Why not add all of them? Cheers /Joel