From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4894 invoked by alias); 28 Sep 2011 17:50:25 -0000 Received: (qmail 4881 invoked by uid 22791); 28 Sep 2011 17:50:23 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Sep 2011 17:50:08 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id p8SHo1u1008958 for ; Wed, 28 Sep 2011 10:50:01 -0700 Received: from qyk32 (qyk32.prod.google.com [10.241.83.160]) by wpaz33.hot.corp.google.com with ESMTP id p8SHnxI7004138 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Wed, 28 Sep 2011 10:50:00 -0700 Received: by qyk32 with SMTP id 32so2472927qyk.3 for ; Wed, 28 Sep 2011 10:49:59 -0700 (PDT) Received: by 10.224.218.2 with SMTP id ho2mr7053028qab.161.1317232199669; Wed, 28 Sep 2011 10:49:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.218.2 with SMTP id ho2mr7053024qab.161.1317232199550; Wed, 28 Sep 2011 10:49:59 -0700 (PDT) Received: by 10.224.80.149 with HTTP; Wed, 28 Sep 2011 10:49:59 -0700 (PDT) In-Reply-To: References: <3A3AF5AE-70E8-43D0-B8CE-DCADFEEF879A@comcast.net> Date: Wed, 28 Sep 2011 19:25:00 -0000 Message-ID: Subject: Re: [RFA] Re: Python: add field access by name and standard python mapping methods to gdb.Type From: Doug Evans To: Paul Koning Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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-09/txt/msg00472.txt.bz2 On Mon, Sep 26, 2011 at 9:00 AM, Paul Koning wrote: > > On Sep 23, 2011, at 12:33 PM, Doug Evans wrote: > > > On Fri, Sep 16, 2011 at 8:27 AM, Paul Koning w= rote: > >> > >> Below is an update with the various comments addressed. > > > > Hi. =A0This email is for just a couple of formatting nits. > > > >> 2011-09-15 =A0Paul Koning =A0 > >> > >> =A0 =A0 =A0 =A0* python/py-type.c (make_fielditem, typy_field_names, t= ypy_items, > >> =A0 =A0 =A0 =A0typy_length, typy_get, typy_has_key, typy_make_iter, > >> =A0 =A0 =A0 =A0typy_iterkeys, typy_iteritems, typy_itervalues, typy_it= er, > >> =A0 =A0 =A0 =A0typy_iterator_iter, typy_iterator_iternext, > >> =A0 =A0 =A0 =A0typy_iterator_dealloc): : New functions to implement st= andard > >> =A0 =A0 =A0 =A0Python mapping methods on gdb.Type object. > >> =A0 =A0 =A0 =A0(gdb.TypeIterator): New Python type. > >> =A0 =A0 =A0 =A0* python/python-internal.h (gdbpy_iter_kind): New enum. > >> =A0 =A0 =A0 =A0* doc/gdb.texinfo (gdb.Type): Document field access by = dictionary > >> =A0 =A0 =A0 =A0key syntax. > > > > Technically speaking, the rule is you can't extend a parenthesized name= list > > over multiple lines. =A0At least that's the rule I've been asked to fol= low. > > I'd like to see some flexibility here, and I'm not asking you change th= is here. > > Just pointing it out. > > > >> +/* Helper function for Type standard mapping methods. =A0Returns a > >> + =A0 Python object for field i of the type. =A0"kind" specifies what = to > >> + =A0 return: the name of the field, a gdb.Field object corresponding = to > >> + =A0 the field, or a tuple consisting of field name and gdb.Field > >> + =A0 object. =A0*/ > >> +static PyObject * > >> +make_fielditem (struct type *type, int i, enum gdbpy_iter_kind kind) > > > > For functions the coding standards say to have a blank line between > > its comment and definition. > > I realize parts of gdb don't follow this rule, but this rule I like :-), > > it is documented, and I'd like to not make things worse. > > > > This needs to be fixed in several places. > > I've fixed both -- the ChangeLog is now formatted according to an earlier= example I see in ChangeLog. > > Ok to commit? > > =A0 =A0 =A0 =A0paul > > 2011-09-26 =A0Paul Koning =A0 > > =A0 =A0 =A0 =A0* python/py-type.c (make_fielditem, typy_field_names, typy= _items) > =A0 =A0 =A0 =A0(typy_length, typy_get, typy_has_key, typy_make_iter) > =A0 =A0 =A0 =A0(typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter) > =A0 =A0 =A0 =A0(typy_iterator_iter, typy_iterator_iternext) > =A0 =A0 =A0 =A0(typy_iterator_dealloc): : New functions to implement stan= dard > =A0 =A0 =A0 =A0Python mapping methods on gdb.Type object. > =A0 =A0 =A0 =A0(gdb.TypeIterator): New Python type. > =A0 =A0 =A0 =A0* python/python-internal.h (gdbpy_iter_kind): New enum. > =A0 =A0 =A0 =A0* doc/gdb.texinfo (gdb.Type): Document field access by dic= tionary > =A0 =A0 =A0 =A0key syntax. > > 2011-09-26 =A0Paul Koning =A0 > > =A0 =A0 =A0 =A0* gdb.python/py-type.c (enum E): New. > =A0 =A0 =A0 =A0* gdb.python/py-type.exp (test_fields): Add tests for Pyth= on > =A0 =A0 =A0 =A0mapping access to fields. > =A0 =A0 =A0 =A0(test_enums): New test for field access on enums. Blech, sorry for the dup. One changelog entry has two colons (::), but other than that it's ok by me. Thanks!