From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15870 invoked by alias); 23 Sep 2011 16:33:48 -0000 Received: (qmail 15858 invoked by uid 22791); 23 Sep 2011 16:33:46 -0000 X-SWARE-Spam-Status: No, hits=-2.1 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) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Sep 2011 16:33:32 +0000 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p8NGXV1U021580 for ; Fri, 23 Sep 2011 09:33:31 -0700 Received: from qyc1 (qyc1.prod.google.com [10.241.81.129]) by hpaq12.eem.corp.google.com with ESMTP id p8NGWwvV013078 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Fri, 23 Sep 2011 09:33:29 -0700 Received: by qyc1 with SMTP id 1so5347053qyc.18 for ; Fri, 23 Sep 2011 09:33:29 -0700 (PDT) Received: by 10.224.218.2 with SMTP id ho2mr3023673qab.161.1316795609136; Fri, 23 Sep 2011 09:33:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.218.2 with SMTP id ho2mr3023665qab.161.1316795608977; Fri, 23 Sep 2011 09:33:28 -0700 (PDT) Received: by 10.224.80.149 with HTTP; Fri, 23 Sep 2011 09:33:28 -0700 (PDT) In-Reply-To: <3A3AF5AE-70E8-43D0-B8CE-DCADFEEF879A@comcast.net> References: <3A3AF5AE-70E8-43D0-B8CE-DCADFEEF879A@comcast.net> Date: Fri, 23 Sep 2011 17:21:00 -0000 Message-ID: Subject: 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, pmuldoon@redhat.com, Eli Zaretskii 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/msg00433.txt.bz2 On Fri, Sep 16, 2011 at 8:27 AM, Paul Koning wrote: > > Below is an update with the various comments addressed. Hi. This 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, typy= _items, > =A0 =A0 =A0 =A0typy_length, typy_get, typy_has_key, typy_make_iter, > =A0 =A0 =A0 =A0typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter, > =A0 =A0 =A0 =A0typy_iterator_iter, typy_iterator_iternext, > =A0 =A0 =A0 =A0typy_iterator_dealloc): : New functions to implement stand= ard > =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. Technically speaking, the rule is you can't extend a parenthesized name list over multiple lines. At least that's the rule I've been asked to follow. I'd like to see some flexibility here, and I'm not asking you change this h= ere. 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.