binutils-gdb/gdb/python
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
..
lib/gdb Don't replace '\' with '\\' in before_prompt_hook 2014-10-30 09:42:36 +08:00
py-arch.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-auto-load.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-block.c constify struct block in some places 2014-06-18 08:16:52 -06:00
py-bpevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-breakpoint.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-cmd.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-continueevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.h New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-events.h New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-evtregistry.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evts.c New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-exitedevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finishbreakpoint.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-frame.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-framefilter.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-function.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-gdb-readline.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-inferior.c New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-infthread.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-lazy-string.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-linetable.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-newobjfileevent.c New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-objfile.c Add gdb.Objfile.progspace attribute. 2014-10-17 10:57:26 -07:00
py-param.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-prettyprint.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-progspace.c Remove some code duplication in py-objfile.c, py-progspace.c. 2014-10-13 12:24:54 -07:00
py-signalevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symbol.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-symtab.c New "producer" attribute of python gdb.Symtab. 2014-09-18 10:09:12 -07:00
py-threadevent.c Add new infrun.h header. 2014-05-22 12:29:11 +01:00
py-type.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-utils.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value.c Remove spurious exceptions.h inclusions 2014-10-08 09:33:22 +01:00
py-varobj.c Iterate over 'struct varobj_item' instead of PyObject 2014-06-12 15:27:19 +08:00
py-xmethods.c Xmethod support in Python. 2014-06-03 10:03:07 -07:00
python-config.py
python-internal.h New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
python.c New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
python.h Extension Language API 2014-02-05 19:27:58 -08:00