This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Substitute '\' with '\\' in extended-prompt
- From: Yao Qi <yao at codesourcery dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 17 Oct 2014 12:09:41 +0800
- Subject: Substitute '\' with '\\' in extended-prompt
- Authentication-results: sourceware.org; auth=none
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 (éå)