This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix py-parameter.exp and scm-parameter.exp path matching


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2631b16a570626a276f1ce6528ff1cd2cc90ce76

commit 2631b16a570626a276f1ce6528ff1cd2cc90ce76
Author: Andy Wingo <wingo@igalia.com>
Date:   Tue Apr 28 11:15:47 2015 +0200

    Fix py-parameter.exp and scm-parameter.exp path matching
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.python/py-parameter.exp:
    	* gdb.guile/scm-parameter.exp: Escape the path that we are
    	matching against, as it might contain characters that are special
    	to regular expressions.

Diff:
---
 gdb/testsuite/ChangeLog                   | 7 +++++++
 gdb/testsuite/gdb.guile/scm-parameter.exp | 3 ++-
 gdb/testsuite/gdb.python/py-parameter.exp | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 89773a1..1967aca 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-28  Andy Wingo  <wingo@igalia.com>
+
+	* gdb.python/py-parameter.exp:
+	* gdb.guile/scm-parameter.exp: Escape the path that we are
+	matching against, as it might contain characters that are special
+	to regular expressions.
+
 2015-04-27  Joel Brobecker  <brobecker@adacore.com>
 
 	* gdb.ada/rec_comp: New testcase.
diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp
index 42a7011..d3015f6 100644
--- a/gdb/testsuite/gdb.guile/scm-parameter.exp
+++ b/gdb/testsuite/gdb.guile/scm-parameter.exp
@@ -30,7 +30,8 @@ gdb_install_guile_utils
 gdb_install_guile_module
 
 # We use "." here instead of ":" so that this works on win32 too.
-gdb_test "guile (print (parameter-value \"directories\"))" "$srcdir/$subdir.\\\$cdir.\\\$cwd"
+set escaped_directory [string_to_regexp "$srcdir/$subdir"]
+gdb_test "guile (print (parameter-value \"directories\"))" "$escaped_directory.\\\$cdir.\\\$cwd"
 
 # Test a simple boolean parameter, and parameter? while we're at it.
 
diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index 61da33f..faa106b 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -32,7 +32,8 @@ if { [is_remote host] } {
     # doesn't set search directories on remote host.
     set directories ".*\\\$cdir.\\\$cwd"
 } else {
-    set directories "$srcdir/$subdir.\\\$cdir.\\\$cwd"
+    set escaped_directory [string_to_regexp "$srcdir/$subdir"]
+    set directories "$escaped_directory.\\\$cdir.\\\$cwd"
 }
 gdb_test "python print (gdb.parameter ('directories'))" $directories


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]