From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15097 invoked by alias); 29 Oct 2014 14:23:52 -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 15088 invoked by uid 89); 29 Oct 2014 14:23:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Oct 2014 14:23:50 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1XjUA3-0000dW-Tq from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 29 Oct 2014 07:23:43 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Wed, 29 Oct 2014 07:23:43 -0700 From: Yao Qi To: 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> Date: Wed, 29 Oct 2014 14:23:00 -0000 In-Reply-To: <1413982654-15995-1-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Wed, 22 Oct 2014 20:57:34 +0800") Message-ID: <87bnovt0v5.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00796.txt.bz2 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 =3D 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. --=20 Yao (=E9=BD=90=E5=B0=A7)