Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: mbilal <mbilal@codesourcery.com>
To: <palves@redhat.com>, <gdb-patches@sourceware.org>
Cc: <jan.kratochvil@redhat.com>
Subject: Re: [PATCH 5/7] PR gdb/15224 , Change the default set history filename to ~/.gdb_history.
Date: Wed, 15 May 2013 11:08:00 -0000	[thread overview]
Message-ID: <51936CAF.2090508@codesourcery.com> (raw)
In-Reply-To: <518A0BA8.9000703@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

Hi
Please find attached updated patch.

In This patch Default location of History file has been changed to user 
home directory (~/.gdb_history).





2013-05-15  Muhammad Bilal  <mbilal@codesourcery.com>

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

     * NEWS: Updated.

2013-05-15  Muhammad Bilal  <mbilal@codesourcery.com>

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

2013-05-15  Muhammad Bilal  <mbilal@codesourcery.com>

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




Thanks,
-Bilal




[-- Attachment #2: 6 --]
[-- Type: text/plain, Size: 2387 bytes --]

diff --git a/gdb/top.c b/gdb/top.c
index 480b67e..83a5fee 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1651,11 +1651,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");
 #else
-      history_filename = concat (current_directory, "/.gdb_history",
-                                (char *)NULL);
+      history_filename = tilde_expand ("~/.gdb_history");
 #endif
     }
   read_history (history_filename);
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 9230ee8..9d2e9ce 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -800,6 +800,15 @@ if ![istarget "*-*-udi*"] then {
        timeout         { fail "(timeout) target remote" }
     }
 }
+#get home directory path
+gdb_test_multiple "show environment HOME" "show home directory" {
+    -re "\nHOME = (.*).\n.*" {
+       set HOME $expect_out(1,string)    
+    }
+}
+#test show history filename
+gdb_test "show history filename" "The filename in which to record the command history is \"[file join $HOME .gdb_history]\"..*" \
+    "show history filename ([file join $HOME foobar.baz])"
 
 #test target
 gdb_test "target" "Argument required .target name.*" "target"
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 1869d74..a9a1f89 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21455,7 +21455,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 7cd1646..04b929f 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.

  reply	other threads:[~2013-05-15 11:08 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06  9:39 [PATCH 0/7] PR gdb/15224 should "set history save on" by default mbilal
2013-05-06  9:40 ` [PATCH 1/7] " mbilal
2013-05-06  9:42   ` [PATCH 2/7] " mbilal
2013-05-06  9:43   ` [PATCH 3/7] " mbilal
2013-05-08  8:23     ` mbilal
     [not found]     ` <51877BC6.6080007@codesourcery.com>
2013-05-06  9:47       ` [PATCH 4/7] " mbilal
2013-05-07  9:40         ` Abid, Hafiz
2013-05-08 17:14         ` Pedro Alves
2013-05-06  9:48       ` [PATCH 5/7] " mbilal
2013-05-08  8:24         ` mbilal
2013-05-15 11:08           ` mbilal [this message]
2013-05-15 11:31             ` [PATCH 5/7] PR gdb/15224 , Change the default set history filename to ~/.gdb_history Eli Zaretskii
2013-05-15 12:07             ` mbilal
2013-05-15 13:27               ` Eli Zaretskii
2013-05-22 17:24                 ` Pedro Alves
2013-05-22 17:49                   ` Eli Zaretskii
2013-05-22 18:08                     ` Pedro Alves
2013-05-22 19:18                       ` Eli Zaretskii
2013-05-22 19:39                         ` Pedro Alves
2013-08-01 12:43                           ` Muhammad Bilal
2013-08-01 15:41                           ` Tom Tromey
2013-08-01 22:17                             ` Doug Evans
2013-05-22 12:02             ` mbilal
2013-05-08 17:05         ` [PATCH 5/7] PR gdb/15224 should "set history save on" by default Pedro Alves
2013-05-06  9:49       ` [PATCH 6/7] " mbilal
2013-05-06  9:51       ` [PATCH 7/7] " mbilal
2013-05-07 10:17         ` Abid, Hafiz
2013-05-08 17:08           ` Pedro Alves
2013-05-08  8:25         ` mbilal
2013-05-08 16:51           ` Eli Zaretskii
2013-05-08 17:18           ` Pedro Alves
2013-05-08  8:23       ` [PATCH 4/7] " mbilal
2013-05-09 11:12         ` mbilal
2013-05-09 12:05           ` Pedro Alves
     [not found]         ` <51936853.7050106@codesourcery.com>
     [not found]           ` <51936944.80108@codesourcery.com>
2013-05-15 10:56             ` [PATCH 4/7] Disable history saving for testsuit mbilal
2013-05-22 12:02               ` mbilal
2013-05-22 17:27               ` Pedro Alves
2013-05-08 16:24     ` [PATCH 3/7] PR gdb/15224 should "set history save on" by default Pedro Alves
2013-05-06 11:26   ` [PATCH 1/7] " Pedro Alves
     [not found]   ` <5188AA15.5010904@codesourcery.com>
2013-05-07  7:19     ` [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path mbilal
2013-05-07  8:39       ` Pedro Alves
     [not found]     ` <5188AC27.1050407@codesourcery.com>
2013-05-07  7:26       ` [PATCH 2/7] PR gdb/15224 fix for Unify interactivity tests to use input_from_terminal_p mbilal
2013-05-08  8:22         ` mbilal
2013-05-08 16:21           ` Pedro Alves
2013-05-09 11:08           ` mbilal
2013-05-09 11:32             ` Pedro Alves
2013-05-07 12:44     ` [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path mbilal
2013-05-08  8:22       ` mbilal
     [not found]         ` <519366E2.90105@codesourcery.com>
2013-05-15 10:46           ` mbilal
2013-05-22 17:51             ` Pedro Alves
2013-05-22 12:04           ` mbilal
2013-05-08 15:46       ` Pedro Alves
2013-05-08 17:25         ` Pedro Alves
2013-05-07 10:01 ` [PATCH 0/7] PR gdb/15224 should "set history save on" by default Abid, Hafiz
2013-08-06 16:35 ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51936CAF.2090508@codesourcery.com \
    --to=mbilal@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox