From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27235 invoked by alias); 7 May 2013 07:19:28 -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 27222 invoked by uid 89); 7 May 2013 07:19:28 -0000 X-Spam-SWARE-Status: No, score=-4.4 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; Tue, 07 May 2013 07:19:25 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UZcBI-0004bP-8L from Muhammad_Bilal@mentor.com ; Tue, 07 May 2013 00:19:24 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 May 2013 00:19:24 -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; Tue, 7 May 2013 08:19:21 +0100 Message-ID: <5188AAF8.1020004@codesourcery.com> Date: Tue, 07 May 2013 07:19: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: , , Subject: Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path References: <51877A32.1030503@codesourcery.com> <51877A99.4060503@codesourcery.com> <5188AA15.5010904@codesourcery.com> In-Reply-To: <5188AA15.5010904@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00176.txt.bz2 Here is a updated patch for Fix relative "set history filename" to by immediately converted to absolute On Monday, May 06, 2013 4:26 PM Pedro Alves wrote: >Please do this in the command's set handler rather than >hacking in the the set/show machinery. Yes, Here I am printing the absolute path in show_history_filename , I think it is more appropriate than using the internal set/show machinery . diff --git a/gdb/top.c b/gdb/top.c index 480b67e..ae93e21 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -729,6 +729,9 @@ static void show_history_filename (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { + if (!IS_ABSOLUTE_PATH (value)) + value = concat (current_directory, "/", value, + (char *)NULL); fprintf_filtered (file, _("The filename in which to record " "the command history is \"%s\".\n"), value); Index: gdb.base/setshow.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/setshow.exp,v retrieving revision 1.30 diff -u -p -r1.30 setshow.exp --- gdb.base/setshow.exp 24 Apr 2013 14:29:17 -0000 1.30 +++ gdb.base/setshow.exp 6 May 2013 06:01:05 -0000 @@ -173,7 +173,8 @@ gdb_test "show history expansion on" "Hi gdb_test_no_output "set history filename foobar.baz" \ "set history filename foobar.baz" #test show history filename foobar.baz -gdb_test "show history filename" "The filename in which to record the command history is \"foobar.baz\"..*" "show history filename (foobar.baz)" +gdb_test "show history filename" "The filename in which to record the command history is \"[file join [pwd] foobar.baz]\"..*" \ + "show history filename \"[file join [pwd] foobar.baz]\"." #test set history save on gdb_test_no_output "set history save on" "set history save on" #test show history save on Thanks, -Bilal