+2018-10-25 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * python/py-cmd.c (cmdpy_completer_helper): Return gdbpy_ref<>.
+ (cmdpy_completer_handle_brkchars): Adjust.
+ (cmdpy_completer): Adjust.
+
2018-10-25 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-linux-nat.c (riscv_linux_nat_target::fetch_registers):
and then a "complete"-completion sequentially. Therefore, we just
recalculate everything twice for TAB-completions.
- This function returns the PyObject representing the Python method
- call. */
+ This function returns a reference to the PyObject representing the
+ Python method call. */
-static PyObject *
+static gdbpy_ref<>
cmdpy_completer_helper (struct cmd_list_element *command,
const char *text, const char *word)
{
PyErr_Clear ();
}
- return resultobj.release ();
+ return resultobj;
}
/* Python function called to determine the break characters of a
{
gdbpy_enter enter_py (get_current_arch (), current_language);
- /* Calling our helper to obtain the PyObject of the Python
+ /* Calling our helper to obtain a reference to the PyObject of the Python
function. */
- gdbpy_ref<> resultobj (cmdpy_completer_helper (command, text, word));
+ gdbpy_ref<> resultobj = cmdpy_completer_helper (command, text, word);
/* Check if there was an error. */
if (resultobj == NULL)
{
gdbpy_enter enter_py (get_current_arch (), current_language);
- /* Calling our helper to obtain the PyObject of the Python
+ /* Calling our helper to obtain a reference to the PyObject of the Python
function. */
- gdbpy_ref<> resultobj (cmdpy_completer_helper (command, text, word));
+ gdbpy_ref<> resultobj = cmdpy_completer_helper (command, text, word);
/* If the result object of calling the Python function is NULL, it
means that there was an error. In this case, just give up. */