From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32441 invoked by alias); 13 Mar 2011 19:39:59 -0000 Received: (qmail 32431 invoked by uid 22791); 13 Mar 2011 19:39:58 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_40,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; Sun, 13 Mar 2011 19:39:48 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2DJdijq004664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Mar 2011 15:39:45 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2DJdhY8027435; Sun, 13 Mar 2011 15:39:43 -0400 From: Phil Muldoon To: Doug Evans Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [patch] [python] Implement stop_p for gdb.Breakpoint References: Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Sun, 13 Mar 2011 22:28:00 -0000 In-Reply-To: (Doug Evans's message of "Fri, 11 Mar 2011 10:27:35 -0800") 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 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00704.txt.bz2 Doug Evans writes: > On Fri, Mar 11, 2011 at 9:43 AM, Tom Tromey wrote: >> Phil> +/* Function that is called when a Python condition is evaluated. = =C2=A0*/ >> Phil> +char *stop_func =3D "stop"; >> >> `static const' > > Better, static const char stop_func[] =3D "stop"; > > Or static const char* const stop_func. I remember a bug about this in 2.5 that did accept const definitions but would later die. (And a patch was checked in. Can't remember by who though). Anyway, Python 2.6 rejects all of the above with: ../../archer/gdb/python/py-breakpoint.c:733:7: error: passing argument 2 of= PyObject_CallMethod=C3=A2 discards qualifiers from pointer target type /usr/include/python2.7/abstract.h:340:29: note: expected char * but argumen= t is of type const char * Cheers Phil > [Assuming the code that uses this doesn't cough, sigh.] > > Plus blank line between function comment and definition please. > [Your very good at catching all other style issues ...] > > +/* Helper function that overrides this Python object's > + PyObject_GenericSetAttr to allow extra validation of the attribute > + being set. */ > +static int > +local_setattro (PyObject *self, PyObject *name, PyObject *v)