This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] [python] Implement stop_p for gdb.Breakpoint


Doug Evans <dje@google.com> writes:

> On Fri, Mar 11, 2011 at 9:43 AM, Tom Tromey <tromey@redhat.com> wrote:
>> Phil> +/* Function that is called when a Python condition is evaluated. Â*/
>> Phil> +char *stop_func = "stop";
>>
>> `static const'
>
> Better, static const char stop_func[] = "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à discards qualifiers from pointer target type
/usr/include/python2.7/abstract.h:340:29: note: expected char * but argument 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]