This is the mail archive of the 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]

Re: [PATCH 4/5] [PR gdb/15224] Change the default set history filename to ~/.gdb_history.

On 08/08/2013 10:20 AM, Muhammad Bilal wrote:
This patch Changed the default set history filename to ~/.gdb_history so that users can easily find it
in $HOME directory.

2013-08-08  Muhammad Bilal  <>

    PR gdb/15224
    * gdb.texinfo (Command History): Changed the default history filename
    to ~/.gdb_history.


2013-08-08  Muhammad Bilal  <>

    PR gdb/15224
    * gdb.base/default.exp: Test default history filename


2013-08-08  Muhammad Bilal  <>

    PR gdb/15224
    * top.c (init_history): Changed the default history filename
    to ~/.gdb_history.
    * NEWS: Updated.

gdb/NEWS                           |    3 +++
gdb/doc/gdb.texinfo                |    2 +-
gdb/testsuite/gdb.base/setshow.exp |    4 ++++
gdb/top.c                          |    6 ++----
4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gdb/top.c b/gdb/top.c
index 33a78da..c9efc4a 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1654,11 +1654,9 @@ init_history (void)
          that was read.  */
 #ifdef __MSDOS__
       /* No leading dots in file names are allowed on MSDOS.  */
-      history_filename = concat (current_directory, "/_gdb_history",
-                                (char *)NULL);
+      history_filename = tilde_expand ("~/_gdb_history");
-      history_filename = concat (current_directory, "/.gdb_history",
-                                (char *)NULL);
+      history_filename = tilde_expand ("~/.gdb_history");
   read_history (history_filename);
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index d9e71d3..be43a5b 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -174,6 +174,10 @@ gdb_test_multiple $test $test {
         pass $test
+#test default history filename
+gdb_test "show history filename" \
+ "The filename in which to record the command history is \"$HOME/\[._\]gdb_history\"..*" \
+    "show history filename (~/.gdb_history)"
 #test set history filename ~/foobar.baz
 gdb_test_no_output "set history filename ~/foobar.baz" \
     "set history filename ~/foobar.baz"
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 6d5dec4..b545bcf 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21513,7 +21513,7 @@ list, and where it writes the command history from this session when it
 exits.  You can access this list through history expansion or through
 the history command editing characters listed below.  This file defaults
 to the value of the environment variable @code{GDBHISTFILE}, or to
-@file{./.gdb_history} (@file{./_gdb_history} on MS-DOS) if this variable
+@file{~/.gdb_history} (@file{~/_gdb_history} on MS-DOS) if this variable
 is not set.
diff --git a/gdb/NEWS b/gdb/NEWS
index 6ee82f7..21882d9 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,9 @@

 *** Changes since GDB 7.6

+* Default location of History file has been changed to user
+home directory (~/.gdb_history).
 * Python scripting

   ** Frame filters and frame decorators have been added.


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