]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2005-11-25 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Sat, 26 Nov 2005 04:42:03 +0000 (04:42 +0000)
committerMichael Snyder <msnyder@vmware.com>
Sat, 26 Nov 2005 04:42:03 +0000 (04:42 +0000)
* linux-nat.c (restart_auto_finish): New set/show variable.
(restart_command): Automatically do "finish" a few times
on request.

gdb/ChangeLog
gdb/linux-nat.c

index 32e5f5a103ffd61bc4bc002dc593b91bbf06aafe..b0e94034e501a961fbbd02b8267dc91c2c9e60a2 100644 (file)
@@ -1,5 +1,9 @@
 2005-11-25  Michael Snyder  <msnyder@redhat.com>
 
+       * linux-nat.c (restart_auto_finish): New set/show variable.
+       (restart_command): Automatically do "finish" a few times
+       on request.
+
        * infrun.c (set_last_target_status): Remove, replace with following.
        (nullify_last_target_wait_ptid): New function.  Now we don't need
        to save this bit of state in linux-nat.
index bc33f2de6355a54098778b97588f6c66d3b4f8e8..204cf16ca607a47b2f997b231206781d2d12bf6a 100644 (file)
@@ -3704,6 +3704,8 @@ checkpoint_command (char *args, int from_tty)
 
 #include "string.h"
 
+static int restart_auto_finish;
+
 static void
 restart_command (char *args, int from_tty)
 {
@@ -3711,7 +3713,7 @@ restart_command (char *args, int from_tty)
   struct fork_info *oldfp = find_fork_ptid (inferior_ptid);
   struct fork_info *newfp;
   ptid_t ptid;
-  int id;
+  int id, i;
 
   if (!args || !*args)
     error ("Requires argument (checkpoint or fork id, see info checkpoint)");
@@ -3738,6 +3740,12 @@ restart_command (char *args, int from_tty)
   select_frame (get_current_frame ());
   printf_filtered ("Switching to %s\n", 
                   target_pid_or_tid_to_str (inferior_ptid));
+
+  for (i = 0; i < restart_auto_finish; i++)
+    {
+      execute_command ("finish", from_tty);
+    }
+
   print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
 }
 
@@ -3752,16 +3760,25 @@ Show whether gdb will detach the child of a fork."), _("\
 Tells gdb whether to detach the child of a fork."), 
                           NULL, NULL, &setlist, &showlist);
 
+  add_setshow_integer_cmd ("restart-auto-finish", class_obscure, 
+                          &restart_auto_finish, _("\
+Set number of finish commands gdb should do on restart of a fork."), _("\
+Show number of finish commands gdb should do on restart of a fork."), _("\
+Tells gdb how many finish commands to do on restart of a fork."),
+                          NULL, NULL, &setlist, &showlist);
+
+
   add_com ("checkpoint", class_obscure, checkpoint_command, _("\
 Fork a duplicate process (experimental)."));
   add_com ("restart", class_obscure, restart_command, _("\
-Flip from parent to child fork (experimental)."));
+Switch between parent and child fork (experimental)."));
+  add_com_alias ("fork", "restart", class_obscure, 1);
   add_com ("delete-checkpoint", class_obscure, delete_checkpoint, _("\
 Delete a fork/checkpoint (experimental)."));
+  add_com_alias ("delete-fork", "delete-checkpoint", class_obscure, 1);
   add_com ("detach-fork", class_obscure, detach_fork_command, _("\
 Detach from a fork/checkpoint (experimental)."));
   add_info ("checkpoints", info_forks_command,
            _("IDs of currently known forks/checkpoints."));
   add_info_alias ("forks", "checkpoints", 0);
 }
-