* inflow.c (kill_command): Moved to infcmd.c.
authorPedro Alves <palves@redhat.com>
Tue, 19 May 2009 10:08:19 +0000 (10:08 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 19 May 2009 10:08:19 +0000 (10:08 +0000)
(_initialize_inflow): Don't add the "kill" command or clear
inferior_ptid here.
* infcmd.c (kill_command): Moved here from inflow.c.
(_initialize_infcmd): Add the "kill" command here.

gdb/ChangeLog
gdb/infcmd.c
gdb/inflow.c

index 033dd7d8aefc0df4e05251d9f8cb63dd526b8c0c..fc55a205487b9015ae74b1e2c198f9f33cc81cb1 100644 (file)
@@ -1,3 +1,11 @@
+2009-05-19  Pedro Alves  <pedro@codesourcery.com>
+
+       * inflow.c (kill_command): Moved to infcmd.c.
+       (_initialize_inflow): Don't add the "kill" command or clear
+       inferior_ptid here.
+       * infcmd.c (kill_command): Moved here from inflow.c.
+       (_initialize_infcmd): Add the "kill" command here.
+
 2009-05-19  Pedro Alves  <pedro@codesourcery.com>
 
        * fork-child.c: Don't include frame.h.  Include terminal.h.
index fcb0f911f2e8db1df98efcbc0dc8ad1fe6d5b6e9..433b0b83d4cd6b609ee332f01b88bff525f6cfae 100644 (file)
@@ -2037,6 +2037,37 @@ vector_info (char *args, int from_tty)
                     get_selected_frame (NULL), args);
 }
 \f
+/* Kill the inferior process.  Make us have no inferior.  */
+
+static void
+kill_command (char *arg, int from_tty)
+{
+  /* FIXME:  This should not really be inferior_ptid (or target_has_execution).
+     It should be a distinct flag that indicates that a target is active, cuz
+     some targets don't have processes! */
+
+  if (ptid_equal (inferior_ptid, null_ptid))
+    error (_("The program is not being run."));
+  if (!query (_("Kill the program being debugged? ")))
+    error (_("Not confirmed."));
+  target_kill ();
+
+  /* If the current target interface claims there's still execution,
+     then don't mess with threads of other processes.  */
+  if (!target_has_execution)
+    {
+      init_thread_list ();             /* Destroy thread info */
+
+      /* Killing off the inferior can leave us with a core file.  If
+        so, print the state we are left in.  */
+      if (target_has_stack)
+       {
+         printf_filtered (_("In %s,\n"), target_longname);
+         print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+       }
+    }
+  bfd_cache_close_all ();
+}
 
 /* Used in `attach&' command.  ARG is a point to an integer
    representing a process id.  Proceed threads of this process iff
@@ -2595,6 +2626,9 @@ fully linked executable files and separately compiled object files as needed."),
               &showlist);
   set_cmd_completer (c, noop_completer);
 
+  add_com ("kill", class_run, kill_command,
+          _("Kill execution of program being debugged."));
+
   add_com ("attach", class_run, attach_command, _("\
 Attach to a process or file outside of GDB.\n\
 This command attaches to another target, of the same type as your last\n\
index f65b9c52c459f8dc4f9f2e08dc899c10c42c9c5d..6ca5bd8cc4a05d179fef87f3eb9ecb75cc739501 100644 (file)
@@ -695,38 +695,6 @@ new_tty_postfork (void)
   inferior_thisrun_terminal = NULL;
 }
 
-\f
-/* Kill the inferior process.  Make us have no inferior.  */
-
-static void
-kill_command (char *arg, int from_tty)
-{
-  /* FIXME:  This should not really be inferior_ptid (or target_has_execution).
-     It should be a distinct flag that indicates that a target is active, cuz
-     some targets don't have processes! */
-
-  if (ptid_equal (inferior_ptid, null_ptid))
-    error (_("The program is not being run."));
-  if (!query (_("Kill the program being debugged? ")))
-    error (_("Not confirmed."));
-  target_kill ();
-
-  /* If the current target interface claims there's still execution,
-     then don't mess with threads of other processes.  */
-  if (!target_has_execution)
-    {
-      init_thread_list ();             /* Destroy thread info */
-
-      /* Killing off the inferior can leave us with a core file.  If
-        so, print the state we are left in.  */
-      if (target_has_stack)
-       {
-         printf_filtered (_("In %s,\n"), target_longname);
-         print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
-       }
-    }
-  bfd_cache_close_all ();
-}
 \f
 /* Call set_sigint_trap when you need to pass a signal on to an attached
    process when handling SIGINT */
@@ -848,11 +816,6 @@ _initialize_inflow (void)
   add_info ("terminal", term_info,
            _("Print inferior's saved terminal status."));
 
-  add_com ("kill", class_run, kill_command,
-          _("Kill execution of program being debugged."));
-
-  inferior_ptid = null_ptid;
-
   terminal_is_ours = 1;
 
   /* OK, figure out whether we have job control.  If neither termios nor
This page took 0.048463 seconds and 4 git commands to generate.