{ "COMPLETE_LOCATION", location_completer },
{ "COMPLETE_COMMAND", command_completer },
{ "COMPLETE_SYMBOL", make_symbol_completion_list_fn },
+ { "COMPLETE_EXPRESSION", expression_completer },
};
#define N_COMPLETERS (sizeof (completers) / sizeof (completers[0]))
PyErr_Clear ();
goto done;
}
- make_cleanup_py_decref (resultobj);
result = NULL;
if (PyInt_Check (resultobj))
done:
+ Py_XDECREF (resultobj);
do_cleanups (cleanup);
return result;
/* Helper for cmdpy_init which locates the command list to use and
pulls out the command name.
-
+
NAME is the command name list. The final word in the list is the
name of the new command. All earlier words must be existing prefix
commands.
*BASE_LIST is set to the final prefix command's list of
*sub-commands.
-
+
START_LIST is the list in which the search starts.
This function returns the xmalloc()d name of the new command. On
return -1;
pfx_name = NULL;
- if (is_prefix != NULL)
+ if (is_prefix != NULL)
{
cmp = PyObject_IsTrue (is_prefix);
if (cmp == 1)
{
int i, out;
-
+
/* Make a normalized form of the command name. */
pfx_name = xmalloc (strlen (name) + 2);
-
+
i = 0;
out = 0;
while (name[i])
return -1;
}
- Py_INCREF (&cmdpy_object_type);
- if (PyModule_AddObject (gdb_module, "Command",
- (PyObject *) &cmdpy_object_type) < 0)
+ if (gdb_pymodule_addobject (gdb_module, "Command",
+ (PyObject *) &cmdpy_object_type) < 0)
return -1;
invoke_cst = PyString_FromString ("invoke");