From: "Matthew McCormick (thewtex)" <matt@mmmccormick.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: archer@sourceware.org
Subject: Re: [PATCH 1/2] [python] Add gdb.value_history_count()
Date: Wed, 30 Dec 2009 17:06:00 -0000 [thread overview]
Message-ID: <f23d1cbc0912300906p3b3aafd8xcbefcc9c4a577f70@mail.gmail.com> (raw)
In-Reply-To: <4B29F2FF.8090408@redhat.com>
On Thu, Dec 17, 2009 at 2:59 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
> 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.
>
Thank you for the comments. An updated patch will follow.
>
>> 2009-12-14 Matt McCormick <matt@mmmccormick.com>
>>
>> * 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 <matt@mmmccormick.com>
>
> * python/py-value.c (gdbpy_value_history_count): Implement
> gdb.value_history_count()
>
> and so on for all ChangeLog entries.
>
Thank you for the note. I have looked at the GNU documentation on
ChangeLog's and some of your commits, and I will try to follow their
lead. I am hacking together a git hook to prototype the commit
message correctly. If anything else in the future is not as it should
be, let me know.
>
>> +/* Implementation of gdb.value_history_count. */
>
>
> For FSF C style, two spaces after the period, please.
>
ok.
>
>> +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 ());
>
ok.
>
> 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.
>
Good point. PyInt_AsLong is not appropriate since the argument is not
a PyObject *, but I changed it to
PyInt_FromLong ((long) get_value_history_count());
>
>> /* Accessor methods. */
>>
>> +int
>> +get_value_history_count()
>> +{
>> + return value_history_count;
>> +}
>> +
>
>
> Space after '('.
>
ok.
>
>>
>> +/* 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. ;)
>
Fixed.
> 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?
I coded a test case and submit that too.
Thanks,
Matt
>
> Cheers,
>
> Phil
>
>
>
>
>
>
next prev parent reply other threads:[~2009-12-30 17:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-13 21:22 Matt McCormick (thewtex)
2009-12-13 21:22 ` [PATCH 2/2] [python] Document gdb.value_history_count() Matt McCormick (thewtex)
2009-12-15 5:51 ` Matthew McCormick (thewtex)
2009-12-15 5:55 ` [PATCH 1/2] [python] Add gdb.value_history_count() Matt McCormick (thewtex)
2009-12-15 5:55 ` [PATCH 2/2] [python] Document gdb.value_history_count Matt McCormick (thewtex)
[not found] ` <4B29F581.1020601@redhat.com>
2009-12-17 9:13 ` Phil Muldoon
2009-12-17 8:59 ` [PATCH 1/2] [python] Add gdb.value_history_count() Phil Muldoon
2009-12-17 14:34 ` Matthew McCormick (thewtex)
2009-12-30 17:06 ` Matthew McCormick (thewtex) [this message]
2009-12-30 17:09 ` [PATCH] " Matt McCormick
2009-12-30 17:17 ` Matt McCormick
2010-01-05 14:51 ` Phil Muldoon
2010-01-05 19:49 ` Tom Tromey
2010-01-06 5:10 ` Matthew McCormick (thewtex)
2010-01-06 5:11 ` Matt McCormick
2010-01-17 19:40 ` Matt McCormick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f23d1cbc0912300906p3b3aafd8xcbefcc9c4a577f70@mail.gmail.com \
--to=matt@mmmccormick.com \
--cc=archer@sourceware.org \
--cc=pmuldoon@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).