From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31544 invoked by alias); 17 Dec 2009 08:59:55 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 31533 invoked by uid 22791); 17 Dec 2009 08:59:54 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4B29F2FF.8090408@redhat.com> Date: Thu, 17 Dec 2009 08:59:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: "Matt McCormick (thewtex)" CC: archer@sourceware.org Subject: Re: [PATCH 1/2] [python] Add gdb.value_history_count() References: <1260856483-24773-1-git-send-email-matt@mmmccormick.com> In-Reply-To: <1260856483-24773-1-git-send-email-matt@mmmccormick.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2009-q4/txt/msg00115.txt.bz2 On 12/15/2009 05:54 AM, Matt McCormick (thewtex) wrote: On the whole this looks ok: a few nits from me. This is not an official review though, Tom will have to look at it. > 2009-12-14 Matt McCormick > > * gdb/python/py-value.c (gdbpy_value_history_count): Implement > gdb.value_history_count() > * gdb/python/python-internal.h (thread_object): Python extension > definition. > * gdb/python/python.c (GdbMethods): Register in module methods. > * gdb/value.c (get_value_history_count): New Function. > * gdb/value.h (get_value_history_count): New Function. The paths here seem wrong. For items in the python directory, the entries belong in the ChangeLog in the src/gdb directory. It should read: 2009-12-14 Matt McCormick * python/py-value.c (gdbpy_value_history_count): Implement gdb.value_history_count() and so on for all ChangeLog entries. > +/* Implementation of gdb.value_history_count. */ For FSF C style, two spaces after the period, please. > +PyObject * > +gdbpy_value_history_count (PyObject *self, PyObject *args) > +{ > + return Py_BuildValue("i", get_value_history_count()); > +} Similarly a space before '(' in a function. So: > + return Py_BuildValue ("i", get_value_history_count ()); While there is nothing wrong with Py_BuildValue, if it is certain that the value is a long or an int, why not use PyLong_AsLong or PyInt_AsLong? I'm purely curious. > /* Accessor methods. */ > > +int > +get_value_history_count() > +{ > + return value_history_count; > +} > + Space after '('. > > +/* Abs number of last entry stored */ > + > +int get_value_history_count(); > + Comments need to be full sentences, with a period. Two spaces at the end please. ;) Even though this is pretty straight-forward, when I add any functionality accessible to the user via the API, I like to add a test to demonstrate it works. This also helps catch regressions in the future. This should be pretty simple to code up. What do you think? Cheers, Phil