Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Substitute '\' with '\\' in extended-prompt
@ 2014-10-17  4:13 Yao Qi
  2014-10-17  8:28 ` Phil Muldoon
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Qi @ 2014-10-17  4:13 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: gdb-patches


Hi Phil,
Why do we do the substitute in extended-prompt in your extended-prompt
patch <https://sourceware.org/ml/gdb-patches/2011-08/msg00236.html> 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 or email.

Such substitute makes the output of "set extended-prompt \w" different
from the output of "pwd" nor "os.getcwdu()"

(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

My patch <https://sourceware.org/ml/gdb-patches/2014-10/msg00423.html>
doesn't work due to this difference.  I'd like to know whether the
substitute is necessary or not.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-30  1:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2014-10-29 23:37             ` Yao Qi
2014-10-30  1:48               ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox