From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26424 invoked by alias); 15 May 2013 11:08:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26412 invoked by uid 89); 15 May 2013 11:08:37 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 15 May 2013 11:08:37 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UcZZS-0006cX-Qg from Muhammad_Bilal@mentor.com ; Wed, 15 May 2013 04:08:34 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 15 May 2013 04:08:35 -0700 Received: from [137.202.157.37] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Wed, 15 May 2013 12:08:32 +0100 Message-ID: <51936CAF.2090508@codesourcery.com> Date: Wed, 15 May 2013 11:08:00 -0000 From: mbilal User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: , CC: Subject: Re: [PATCH 5/7] PR gdb/15224 , Change the default set history filename to ~/.gdb_history. References: <51877A32.1030503@codesourcery.com> <51877A99.4060503@codesourcery.com> <51877B42.7@codesourcery.com> <51877BC6.6080007@codesourcery.com> <51877C76.2000509@codesourcery.com> <518A0BA8.9000703@codesourcery.com> In-Reply-To: <518A0BA8.9000703@codesourcery.com> Content-Type: multipart/mixed; boundary="------------050101070307060707090509" X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00514.txt.bz2 --------------050101070307060707090509 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 674 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 PR gdb/15224 * top.c (init_history): Change the default history filename to ~/.gdb_history. * NEWS: Updated. 2013-05-15 Muhammad Bilal PR gdb/15224 * gdb.base/default.exp: Test default history filename Path. 2013-05-15 Muhammad Bilal PR gdb/15224 * gdb.texinfo (Command History): Change the default history filename to ~/.gdb_history. Thanks, -Bilal --------------050101070307060707090509 Content-Type: text/plain; charset="UTF-8"; name="6" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="6" Content-length: 2387 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. --------------050101070307060707090509--