summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2005-11-26 04:42:03 +0000
committerMichael Snyder <msnyder@specifix.com>2005-11-26 04:42:03 +0000
commitfcb63023853d9fc36ee55cbcf074cfdf92df341c (patch)
tree6701fecdc8136ea99d81d2297c7dde2b5dfadab1
parent3196f2e1a6cac07a202f9e931d0ca1176ad4217b (diff)
downloadgdb-fcb63023853d9fc36ee55cbcf074cfdf92df341c.tar.gz
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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/linux-nat.c23
2 files changed, 24 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 32e5f5a103f..b0e94034e50 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index bc33f2de635..204cf16ca60 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -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);
}
-