+2018-10-25 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * python/py-function.c (convert_values_to_python): Return
+ gdbpy_ref<>. Add header comment.
+ (fnpy_call): Adjust.
+
2018-10-25 Andrew Burgess <andrew.burgess@embecosm.com>
* python/py-cmd.c (cmdpy_completer_helper): Return gdbpy_ref<>.
\f
-static PyObject *
+/* Return a reference to a tuple ARGC elements long. Each element of the
+ tuple is a PyObject converted from the corresponding element of ARGV. */
+
+static gdbpy_ref<>
convert_values_to_python (int argc, struct value **argv)
{
int i;
return NULL;
PyTuple_SetItem (result.get (), i, elt.release ());
}
- return result.release ();
+ return result;
}
/* Call a Python function object's invoke method. */
gdbpy_enter enter_py (gdbarch, language);
struct value *value;
gdbpy_ref<> result;
- gdbpy_ref<> args (convert_values_to_python (argc, argv));
+ gdbpy_ref<> args = convert_values_to_python (argc, argv);
/* convert_values_to_python can return NULL on error. If we
encounter this, do not call the function, but allow the Python ->