From f3c8a52aceef30de05174ef7232578535a9cb32a Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 6 Aug 2012 17:13:27 +0000 Subject: [PATCH] gdb/ 2012-08-06 Nathaniel Flath * NEWS: New entry for 'cd' default parameters. * cli/cli-cmds.c (cd_command): Replace error_no_arg by DIR assignment. gdb/doc/ 2012-08-06 Nathaniel Flath * gdb.texinfo (Working Directory): Added information about new default argument for 'cd' command. --- gdb/ChangeLog | 5 +++++ gdb/NEWS | 3 +++ gdb/cli/cli-cmds.c | 2 +- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 5 +++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 336ab5edf7e..09886104a9e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-08-06 Nathaniel Flath + + * NEWS: New entry for 'cd' default parameters. + * cli/cli-cmds.c (cd_command): Replace error_no_arg by DIR assignment. + 2012-08-03 Tom Tromey * dwarf2-frame.c (dwarf2_frame_cache): Call do_cleanups before diff --git a/gdb/NEWS b/gdb/NEWS index a590bee506c..06df79e8a13 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,9 @@ *** Changes since GDB 7.5 +* The 'cd' command now defaults to using '~' (the home directory) if not + given an argument. + * New configure options --enable-libmcheck/--disable-libmcheck diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index f2328e8ce7d..d9849caa394 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -365,7 +365,7 @@ cd_command (char *dir, int from_tty) dont_repeat (); if (dir == 0) - error_no_arg (_("new working directory")); + dir = "~"; dir = tilde_expand (dir); make_cleanup (xfree, dir); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 91d273fb9ca..ef48356e7bc 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-08-06 Nathaniel Flath + + * gdb.texinfo (Working Directory): Added information about new + default argument for 'cd' command. + 2012-08-06 Yao Qi * gdb.texinfo (Remote Configuration): Add kindex for 'set diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9f9fe40670a..d5e65852e21 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2267,8 +2267,9 @@ Specify Files}. @table @code @kindex cd @cindex change working directory -@item cd @var{directory} -Set the @value{GDBN} working directory to @var{directory}. +@item cd @r{[}@var{directory}@r{]} +Set the @value{GDBN} working directory to @var{directory}. If not +given, @var{directory} uses @file{'~'}. @kindex pwd @item pwd -- 2.30.2