This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python][patch] And range method to type


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]