This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [python][patch] And range method to type
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 04 Dec 2009 11:13:02 -0700
- Subject: Re: [python][patch] And range method to type
- References: <4B1929DC.7070809@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> This patch adds a "range" method for GDB.Types. It only supports types
Phil> that support a range, or the range type itself.
Phil> + if (TYPE_CODE (type) != TYPE_CODE_ARRAY &&
Phil> + TYPE_CODE (type) != TYPE_CODE_STRING &&
Phil> + TYPE_CODE (type) != TYPE_CODE_RANGE)
In the GNU style, the "&&"s go at the start of the line.
I think this code should check for failures from PyLong_FromLong and
PyTuple_SetItem. I realize that is a pain, but if one of those does
fail, a failure to check will yield weird problems.
Phil> Return a type of pointer to this type." },
Phil> + { "range", typy_range, METH_NOARGS,
Phil> + "range () -> Tuple\n\
It should be "tuple", as that is the name of the returned type.
Tom