This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Escape backslash in windows path
- From: Yao Qi <yao at codesourcery dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 31 Mar 2014 09:04:27 +0800
- Subject: Re: [PATCH] Escape backslash in windows path
- Authentication-results: sourceware.org; auth=none
- References: <1396058002-13704-1-git-send-email-yao at codesourcery dot com> <53366280 dot 5050909 at redhat dot com>
On 03/29/2014 02:04 PM, Keith Seitz wrote:
>> + # Escape backslash in case HOME is a windows path.
>> > + regsub -all {\\} $HOME {\\\\} HOME
>> > pass $test
>> > }
>> > }
> Does string_to_regexp work for this?
Yes, I didn't know this procedure before. Update the patch using
string_to_regexp.
--
Yao (éå)
gdb/testsuite:
2014-03-31 Yao Qi <yao@codesourcery.com>
* gdb.base/setshow.exp: Invoke string_to_regexp to HOME and PWD.
---
gdb/testsuite/gdb.base/setshow.exp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index 13da410..639ca72 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -179,7 +179,7 @@ gdb_test_no_output "set history filename ~/foobar.baz" \
"set history filename ~/foobar.baz"
#test show history filename ~/foobar.baz
gdb_test "show history filename" \
- "The filename in which to record the command history is \"$HOME/foobar.baz\"..*" \
+ "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \
"show history filename (~/foobar.baz)"
#get current working directory
set PWD ""
@@ -195,7 +195,7 @@ gdb_test_no_output "set history filename foobar.baz" \
"set history filename foobar.baz"
#test show history filename foobar.baz
gdb_test "show history filename" \
- "The filename in which to record the command history is \"$PWD/foobar.baz\"..*" \
+ "The filename in which to record the command history is \"[string_to_regexp $PWD]/foobar.baz\"..*" \
"show history filename (current_directory/foobar.baz)"
#test set history save on
gdb_test_no_output "set history save on" "set history save on"
--
1.7.7.6