diff options
author | Michael Snyder <msnyder@vmware.com> | 2006-04-27 23:03:42 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2006-04-27 23:03:42 +0000 |
commit | b8db102de3021178e81c42925bd6bcbcd3524dec (patch) | |
tree | 867c0975ee77d284e054e6dd99ad7d5c53252fc6 /gdb/linux-fork.c | |
parent | 75b8939e07dc255a6b075be0fd71b0d03bec1efe (diff) | |
download | gdb-b8db102de3021178e81c42925bd6bcbcd3524dec.zip gdb-b8db102de3021178e81c42925bd6bcbcd3524dec.tar.gz gdb-b8db102de3021178e81c42925bd6bcbcd3524dec.tar.bz2 |
2006-04-26 Michael Snyder <msnyder@redhat.com>
* linux-fork.c (_initialize_linux_fork): Rename "delete-fork"
command to "delete fork" (no hyphen), compatible with other
"delete" commands.
(info_forks_command): Accept a fork ID argument, for info
on a single fork. Report if no matching forks.
2006-04-26 Michael Snyder <msnyder@redhat.com>
* gdb.base/multi-forks.exp: Modify patterns for "run to exit",
which may have to consume output from other forks.
Add tests to make sure that "delete fork" succeeded.
2006-04-27 Michael Snyder <msnyder@redhat.com>
* gdb.texinfo (delete-fork): Command renamed to "delete fork".
Diffstat (limited to 'gdb/linux-fork.c')
-rw-r--r-- | gdb/linux-fork.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index bb44682..e96275b 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -448,9 +448,18 @@ info_forks_command (char *arg, int from_tty) struct fork_info *fp; int cur_line; ULONGEST pc; + int requested = -1; + struct fork_info *printed = NULL; + + if (arg && *arg) + requested = (int) parse_and_eval_long (arg); for (fp = fork_list; fp; fp = fp->next) { + if (requested > 0 && fp->num != requested) + continue; + + printed = fp; if (ptid_equal (fp->ptid, inferior_ptid)) { printf_filtered ("* "); @@ -490,6 +499,13 @@ info_forks_command (char *arg, int from_tty) putchar_filtered ('\n'); } + if (printed == NULL) + { + if (requested > 0) + printf_filtered (_("No fork number %d.\n"), requested); + else + printf_filtered (_("No forks.\n")); + } } /* Save/restore mode variable 'detach_fork': @@ -670,11 +686,12 @@ Fork a duplicate process (experimental).")); restart <n>: restore program context from a checkpoint.\n\ Argument 'n' is checkpoint ID, as displayed by 'info checkpoints'.")); - /* Delete-checkpoint command: kill the process and remove it from + /* Delete checkpoint command: kill the process and remove it from fork list. */ - add_com ("delete-checkpoint", class_obscure, delete_fork_command, _("\ -Delete a fork/checkpoint (experimental).")); + add_cmd ("checkpoint", class_obscure, delete_fork_command, _("\ +Delete a fork/checkpoint (experimental)."), + &deletelist); /* Detach-checkpoint command: release the process to run independantly, and remove it from the fork list. */ @@ -691,7 +708,7 @@ Detach from a fork/checkpoint (experimental).")); /* Command aliases (let "fork" and "checkpoint" be used interchangeably). */ - add_com_alias ("delete-fork", "delete-checkpoint", class_obscure, 1); + add_alias_cmd ("fork", "checkpoint", class_obscure, 1, &deletelist); add_com_alias ("detach-fork", "detach-checkpoint", class_obscure, 1); add_info_alias ("forks", "checkpoints", 0); |