From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1661 invoked by alias); 29 Oct 2014 14:39:41 -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 1596 invoked by uid 89); 29 Oct 2014 14:39:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 29 Oct 2014 14:39:39 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9TEdbPL018402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Oct 2014 10:39:37 -0400 Received: from localhost.localdomain (ovpn-112-76.ams2.redhat.com [10.36.112.76]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9TEdZ4A025546; Wed, 29 Oct 2014 10:39:36 -0400 Message-ID: <5450FC27.9060308@redhat.com> Date: Wed, 29 Oct 2014 14:39:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Don't replace '\' with '\\' in before_prompt_hook References: <878ukfkkog.fsf@codesourcery.com> <1413982654-15995-1-git-send-email-yao@codesourcery.com> <87bnovt0v5.fsf@codesourcery.com> <5450FAED.1010005@redhat.com> In-Reply-To: <5450FAED.1010005@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00799.txt.bz2 On 29/10/14 14:34, Phil Muldoon wrote: > On 29/10/14 14:19, Yao Qi wrote: >> Yao Qi writes: >> >>> In gdb/command/prompt.py:before_prompt_hook, the '\' in the new prompt >>> is replaced with '\\', shown as below, >>> >>>> def before_prompt_hook(self, current): >>>> if self.value is not '': >>>> newprompt = gdb.prompt.substitute_prompt(self.value) >>>> return newprompt.replace('\\', '\\\\') >>>> else: >>>> return None >>> I don't see any explanations on this in comments nor email. As doc >>> said, "set extended-prompt \w" substitute the current working >>> directory, but it prints something different from what pwd or >>> os.getcwdu() prints on mingw32 host. >>> >>> (gdb) python print os.getcwdu()^M >>> \\build2-lucid-cs\yqi\yqi\arm-none-eabi >>> >>> (gdb) pwd^M >>> Working directory \\build2-lucid-cs\yqi\yqi\arm-none-eabi >>> >>> (gdb) set extended-prompt \w >>> \\\\build2-lucid-cs\\yqi\\yqi\\arm-none-eabi >>> >>> This makes me think whether the substitution in before_prompt_hook is >>> necessary or not. This patch is to remove this substitution. >>> >>> Run gdb.python on x86_64-linux and arm-none-eabi on mingw32 host. No >>> regressions. Is it OK? >>> >>> gdb: >>> >>> 2014-10-22 Yao Qi >>> >>> * python/lib/gdb/command/prompt.py (before_prompt_hook): Don't >>> replace '\\' with '\\\\'.: >> The trailing : can be removed. I appreciate people familiar with gdb >> python can review this patch, so, here is a ping. >> > If the tests pass, I think it is fine. We are not close to a release, > so we can put it back if it causes issues (and fix up some new tests > to catch the regression.) > Oops I better clarify, this is for mainline, not the impending 7.8.1 release? Cheers Phil