From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28796 invoked by alias); 29 Oct 2014 14:34:31 -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 28786 invoked by uid 89); 29 Oct 2014 14:34:30 -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:34:30 +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 s9TEYN4j021660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Oct 2014 10:34:23 -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 s9TEYLsS021913; Wed, 29 Oct 2014 10:34:22 -0400 Message-ID: <5450FAED.1010005@redhat.com> Date: Wed, 29 Oct 2014 14:34: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> In-Reply-To: <87bnovt0v5.fsf@codesourcery.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00797.txt.bz2 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.) Cheers Phil