This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Rename detach-checkpoint to detach checkpoint


This patch renames the detach-checkpoint command to detach checkpoint to
fix the annoyance that all abbreviations of the detach command have become
ambiguous.

Andreas.

2006-10-27  Andreas Schwab  <schwab@suse.de>

	* gdbcmd.h (detachlist): Declare.
	* infcmd.c (_initialize_infcmd): Define "detach" as prefix
	command.
	* linux-fork.c (_initialize_linux_fork): Rename
	"detach-checkpoint" to "detach checkpoint" and "detach-fork" to
	"detach fork".
	* cli/cli-cmds.c (detachlist): Define.
	(init_cmd_lists): Initialize it.
	* cli/cli-cmds.h (detachlist): Declare.

doc/:
	* gdb.texinfo (Processes): Rename "detach-fork" to "detach fork".

testsuite/:
	* gdb.base/multi-forks.exp: Use "detach fork" instead of
	"detach-fork".

Index: gdb/gdbcmd.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbcmd.h,v
retrieving revision 1.13
diff -u -a -p -r1.13 gdbcmd.h
--- gdb/gdbcmd.h	17 Dec 2005 22:34:00 -0000	1.13
+++ gdb/gdbcmd.h	27 Oct 2006 21:23:42 -0000
@@ -50,6 +50,10 @@ extern struct cmd_list_element *disablel
 
 extern struct cmd_list_element *deletelist;
 
+/* Chain containing all defined detach subcommands.  */
+
+extern struct cmd_list_element *detachlist;
+
 /* Chain containing all defined toggle subcommands.  */
 
 extern struct cmd_list_element *togglelist;
Index: gdb/infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.145
diff -u -a -p -r1.145 infcmd.c
--- gdb/infcmd.c	21 Sep 2006 13:54:02 -0000	1.145
+++ gdb/infcmd.c	27 Oct 2006 21:23:42 -0000
@@ -2123,10 +2123,11 @@ directory, or (if not found there) using
 (see the \"directory\" command).  You can also use the \"file\" command\n\
 to specify the program, and to load its symbol table."));
 
-  add_com ("detach", class_run, detach_command, _("\
+  add_prefix_cmd ("detach", class_run, detach_command, _("\
 Detach a process or file previously attached.\n\
 If a process, it is no longer traced, and it continues its execution.  If\n\
-you were debugging a file, the file is closed and gdb no longer accesses it."));
+you were debugging a file, the file is closed and gdb no longer accesses it."),
+		  &detachlist, "detach ", 0, &cmdlist);
 
   add_com ("disconnect", class_run, disconnect_command, _("\
 Disconnect from a target.\n\
Index: gdb/linux-fork.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-fork.c,v
retrieving revision 1.7
diff -u -a -p -r1.7 linux-fork.c
--- gdb/linux-fork.c	27 Apr 2006 23:03:41 -0000	1.7
+++ gdb/linux-fork.c	27 Oct 2006 21:23:44 -0000
@@ -693,11 +693,12 @@ Argument 'n' is checkpoint ID, as displa
 Delete a fork/checkpoint (experimental)."),
 	   &deletelist);
 
-  /* Detach-checkpoint command: release the process to run independantly, 
+  /* Detach checkpoint command: release the process to run independantly, 
      and remove it from the fork list.  */
 
-  add_com ("detach-checkpoint", class_obscure, detach_fork_command, _("\
-Detach from a fork/checkpoint (experimental)."));
+  add_cmd ("checkpoint", class_obscure, detach_fork_command, _("\
+Detach from a fork/checkpoint (experimental)."),
+	   &detachlist);
 
   /* Info checkpoints command: list all forks/checkpoints 
      currently under gdb's control.  */
@@ -709,7 +710,7 @@ Detach from a fork/checkpoint (experimen
      interchangeably).  */
 
   add_alias_cmd ("fork", "checkpoint", class_obscure, 1, &deletelist);
-  add_com_alias ("detach-fork", "detach-checkpoint", class_obscure, 1);
+  add_alias_cmd ("fork", "checkpoint", class_obscure, 1, &detachlist);
   add_info_alias ("forks", "checkpoints", 0);
 
   /* "fork <n>" (by analogy to "thread <n>").  */
Index: gdb/cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.66
diff -u -a -p -r1.66 cli-cmds.c
--- gdb/cli/cli-cmds.c	21 Jul 2006 14:46:53 -0000	1.66
+++ gdb/cli/cli-cmds.c	27 Oct 2006 21:23:51 -0000
@@ -122,6 +122,10 @@ struct cmd_list_element *stoplist;
 
 struct cmd_list_element *deletelist;
 
+/* Chain containing all defined detach subcommands. */
+
+struct cmd_list_element *detachlist;
+
 /* Chain containing all defined "enable breakpoint" subcommands. */
 
 struct cmd_list_element *enablebreaklist;
@@ -1089,6 +1093,7 @@ init_cmd_lists (void)
   togglelist = NULL;
   stoplist = NULL;
   deletelist = NULL;
+  detachlist = NULL;
   enablebreaklist = NULL;
   setlist = NULL;
   unsetlist = NULL;
Index: gdb/cli/cli-cmds.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.h,v
retrieving revision 1.7
diff -u -a -p -r1.7 cli-cmds.h
--- gdb/cli/cli-cmds.h	21 Jul 2006 14:46:53 -0000	1.7
+++ gdb/cli/cli-cmds.h	27 Oct 2006 21:23:51 -0000
@@ -1,5 +1,5 @@
 /* Header file for GDB CLI command implementation library.
-   Copyright (c) 2000 Free Software Foundation, Inc.
+   Copyright (c) 2000, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -39,6 +39,10 @@ extern struct cmd_list_element *disablel
 
 extern struct cmd_list_element *deletelist;
 
+/* Chain containing all defined detach subcommands. */
+
+extern struct cmd_list_element *detachlist;
+
 /* Chain containing all defined toggle subcommands. */
 
 extern struct cmd_list_element *togglelist;
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.365
diff -u -a -p -r1.365 gdb/doc/gdb.texinfo
--- gdb/doc/gdb.texinfo	21 Oct 2006 13:06:03 -0000	1.365
+++ gdb/doc/gdb.texinfo	27 Oct 2006 21:43:57 -0000
@@ -2574,13 +2574,13 @@ as shown in the first field of the @samp
 @end table
 
 To quit debugging one of the forked processes, you can either detach
-from it by using the @w{@code{detach-fork}} command (allowing it to
+from it by using the @w{@code{detach fork}} command (allowing it to
 run independently), or delete (and kill) it using the
 @w{@code{delete fork}} command.
 
 @table @code
-@kindex detach-fork @var{fork-id}
-@item detach-fork @var{fork-id}
+@kindex detach fork @var{fork-id}
+@item detach fork @var{fork-id}
 Detach from the process identified by @value{GDBN} fork number
 @var{fork-id}, and remove it from the fork list.  The process will be
 allowed to run independently.
Index: gdb/testsuite/gdb.base/multi-forks.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/multi-forks.exp,v
retrieving revision 1.6
diff -u -a -p -r1.6 gdb/testsuite/gdb.base/multi-forks.exp
--- gdb/testsuite/gdb.base/multi-forks.exp	18 Sep 2006 21:17:07 -0000	1.6
+++ gdb/testsuite/gdb.base/multi-forks.exp	27 Oct 2006 21:54:34 -0000
@@ -128,14 +128,14 @@ gdb_test "restart 0" " main .*" "restart
 #
 
 # 
-# Test detach-fork
+# Test detach fork
 # 
 
 # [assumes we're at #0]
-gdb_test "detach-fork 1" "Detached .*" "Detach 1"
-gdb_test "detach-fork 2" "Detached .*" "Detach 2"
-gdb_test "detach-fork 3" "Detached .*" "Detach 3"
-gdb_test "detach-fork 4" "Detached .*" "Detach 4"
+gdb_test "detach fork 1" "Detached .*" "Detach 1"
+gdb_test "detach fork 2" "Detached .*" "Detach 2"
+gdb_test "detach fork 3" "Detached .*" "Detach 3"
+gdb_test "detach fork 4" "Detached .*" "Detach 4"
 
 # 
 # Test delete fork

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]