This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix gdb.guile/scm-parameter.exp path matching
- From: Andy Wingo <wingo at igalia dot com>
- To: gdb-patches at sourceware dot org
- Cc: dje at google dot com
- Date: Thu, 09 Apr 2015 14:36:40 +0200
- Subject: [PATCH] Fix gdb.guile/scm-parameter.exp path matching
- Authentication-results: sourceware.org; auth=none
OK to commit? For me the test was failing for
srcdir=/home/wingo/src/binutils-gdb/+2.0/../gdb/testsuite.
Andy
>From 9eed15669df55cc792353e44d041a64af5249177 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@igalia.com>
Date: Thu, 9 Apr 2015 14:32:54 +0200
Subject: [PATCH] Fix gdb.guile/scm-parameter.exp path matching
gdb/testsuite/ChangeLog:
* 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 | 6 ++++++
gdb/testsuite/gdb.guile/scm-parameter.exp | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 73785d6..edc6b2e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2015-04-09 Andy Wingo <wingo@igalia.com>
+ * 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-09 Andy Wingo <wingo@igalia.com>
+
* gdb.guile/scm-frame.exp: Add frame-read-register tests, modelled
after the Python tests.
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.
--
2.1.4