Remove trailing whitespace.
[deliverable/binutils-gdb.git] / gdb / python / py-cmd.c
index ba765e098a738184740f0fa2972edc106d363494..c0e9d9696b8c33609ddddcf7d96ece4643d92cf0 100644 (file)
@@ -45,6 +45,7 @@ static struct cmdpy_completer completers[] =
   { "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]))
@@ -244,7 +245,6 @@ cmdpy_completer (struct cmd_list_element *command,
       PyErr_Clear ();
       goto done;
     }
-  make_cleanup_py_decref (resultobj);
 
   result = NULL;
   if (PyInt_Check (resultobj))
@@ -300,6 +300,7 @@ cmdpy_completer (struct cmd_list_element *command,
 
  done:
 
+  Py_XDECREF (resultobj);
   do_cleanups (cleanup);
 
   return result;
@@ -307,14 +308,14 @@ cmdpy_completer (struct cmd_list_element *command,
 
 /* 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
@@ -463,16 +464,16 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
     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])
@@ -600,9 +601,8 @@ gdbpy_initialize_commands (void)
        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");
This page took 0.025569 seconds and 4 git commands to generate.