This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix mi-file.exp fails on remote host
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Tue, 13 May 2014 15:34:34 +0800
- Subject: [PATCH] Fix mi-file.exp fails on remote host
- Authentication-results: sourceware.org; auth=none
This patch fixes mi-file.exp fails on remote host. First, we can't
assume ${srcdir}/${subdir}/${srcfile} directory exists on remote host,
so this patch changes it to match ${srcfile} only on remote host.
Second, regexp pattern ".*/${srcfile}" isn't friendly to Windows path,
and the file name is "basics.c" in my test env, so use string_to_regexp
instead.
gdb/testsuite:
2014-05-13 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi-file.exp (test_file_list_exec_source_file): Don't
match absolute path on remote host.
(test_file_list_exec_source_files): Use string_to_regexp.
---
gdb/testsuite/gdb.mi/mi-file.exp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.mi/mi-file.exp b/gdb/testsuite/gdb.mi/mi-file.exp
index 85998a2..109dcce 100644
--- a/gdb/testsuite/gdb.mi/mi-file.exp
+++ b/gdb/testsuite/gdb.mi/mi-file.exp
@@ -39,7 +39,11 @@ proc test_file_list_exec_source_file {} {
global srcdir
global subdir
global fullname_syntax
- set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
+ if { [is_remote host] } {
+ set srcfilepath [string_to_regexp ${srcfile}]
+ } else {
+ set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
+ }
# get the path and absolute path to the current executable
#
@@ -64,7 +68,7 @@ proc test_file_list_exec_source_files {} {
# get the path and absolute path to the current executable
mi_gdb_test "222-file-list-exec-source-files" \
- "222\\\^done,files=\\\[\{file=\".*/${srcfile}\",fullname=\"$fullname_syntax${srcfile}\"\}.*]" \
+ "222\\\^done,files=\\\[\{file=\"[string_to_regexp ${srcfile}]\",fullname=\"$fullname_syntax${srcfile}\"\}.*]" \
"Getting a list of source files."
}
--
1.9.0