binutils-gdb/gdb/python/lib/gdb
Yao Qi 6427bef6d1 Don't replace '\' with '\\' in before_prompt_hook
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.

gdb:

2014-10-30  Yao Qi  <yao@codesourcery.com>

	* python/lib/gdb/command/prompt.py (before_prompt_hook): Don't
	replace '\\' with '\\\\'.
2014-10-30 09:42:36 +08:00
..
command Don't replace '\' with '\\' in before_prompt_hook 2014-10-30 09:42:36 +08:00
function PR 15276: Add $_caller_is, $_caller_matches, $_any_caller_is, $_any_caller_matches 2014-09-06 09:15:44 -07:00
printer PR python/17364 2014-10-15 11:43:49 -07:00
__init__.py PR python/17364 2014-10-15 11:43:49 -07:00
FrameDecorator.py avoid python exception in FrameDecorator.py 2014-01-23 08:03:52 -07:00
FrameIterator.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frames.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
printing.py PR python/17364 2014-10-15 11:43:49 -07:00
prompt.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
types.py Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
xmethod.py Xmethod support in Python. 2014-06-03 10:03:07 -07:00