Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Yao Qi <yao@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't replace '\' with '\\' in before_prompt_hook
Date: Wed, 29 Oct 2014 14:39:00 -0000	[thread overview]
Message-ID: <5450FC27.9060308@redhat.com> (raw)
In-Reply-To: <5450FAED.1010005@redhat.com>

On 29/10/14 14:34, Phil Muldoon wrote:
> On 29/10/14 14:19, Yao Qi wrote:
>> Yao Qi <yao@codesourcery.com> 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  <yao@codesourcery.com>
>>>
>>>     * 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


  reply	other threads:[~2014-10-29 14:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17  4:13 Substitute '\' with '\\' in extended-prompt Yao Qi
2014-10-17  8:28 ` Phil Muldoon
2014-10-17 11:23   ` Yao Qi
2014-10-22 13:01     ` [PATCH] Don't replace '\' with '\\' in before_prompt_hook Yao Qi
2014-10-29 14:23       ` Yao Qi
2014-10-29 14:34         ` Phil Muldoon
2014-10-29 14:39           ` Phil Muldoon [this message]
2014-10-29 23:37             ` Yao Qi
2014-10-30  1:48               ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5450FC27.9060308@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox