Fix py-parameter.exp and scm-parameter.exp path matching
authorAndy Wingo <wingo@igalia.com>
Tue, 28 Apr 2015 09:15:47 +0000 (11:15 +0200)
committerAndy Wingo <wingo@igalia.com>
Tue, 28 Apr 2015 09:15:47 +0000 (11:15 +0200)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-parameter.exp
gdb/testsuite/gdb.python/py-parameter.exp

index 89773a13f94ce3af564d2673c995a82267d79db6..1967acae1495240e1cbd3adcd6d6644a6c83a5bc 100644 (file)
@@ -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.
index 42a7011ff79de8b265cdf98379df1401590d7fcf..d3015f64512efb6e7285e31292da8824b1b29ab2 100644 (file)
@@ -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.
 
index 61da33f3e7fc34a9f042fa18c9d8f99fb003d114..faa106bef423b1a011659411b8b7e99521307cc2 100644 (file)
@@ -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
 
This page took 0.030413 seconds and 4 git commands to generate.