From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12206 invoked by alias); 13 May 2014 07:37:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12197 invoked by uid 89); 13 May 2014 07:37:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 May 2014 07:37:36 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Wk7HI-0003jc-Nf from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 13 May 2014 00:37:32 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 13 May 2014 00:37:32 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Tue, 13 May 2014 00:36:06 -0700 From: Yao Qi To: Subject: [PATCH] Fix mi-file.exp fails on remote host Date: Tue, 13 May 2014 07:37:00 -0000 Message-ID: <1399966474-6106-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00148.txt.bz2 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 * 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