From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15688 invoked by alias); 14 May 2014 02:22:54 -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 15662 invoked by uid 89); 14 May 2014 02:22:52 -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; Wed, 14 May 2014 02:22:51 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WkOqG-00035Y-30 from Yao_Qi@mentor.com ; Tue, 13 May 2014 19:22:48 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 13 May 2014 19:22:48 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Tue, 13 May 2014 19:22:46 -0700 Message-ID: <5372D2D6.2040903@codesourcery.com> Date: Wed, 14 May 2014 02:22:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH] Fix mi-file.exp fails on remote host References: <1399966474-6106-1-git-send-email-yao@codesourcery.com> <537264BF.8050402@redhat.com> In-Reply-To: <537264BF.8050402@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00185.txt.bz2 On 05/14/2014 02:30 AM, Pedro Alves wrote: > I don't get this rationale. I mean, I get that . is special in regexps, but > although not strictly correct, it's usually harmless. I believe we have a > ton of cases of just passing a filename with a dot as a regexp, as evidenced > by ... > >> > # 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." > ... the second ${srcfile} in the exact same line your changing. So it > looks odd to have to change one, but not the other. Sorry for being unclear. It is not about ".", the culprit is "/" in ".*/${srcfile}". The test fails in my env because the file name is "basics.c". At first, I remove "/" from the pattern and think better to convert it to "string_to_regexp ${srcfile}". During the cleanup, I remove the ".*" prefix by mistake, sorry :( Here is the new one. -- Yao (齐尧) Subject: [PATCH] Fix mi-file.exp fails on remote host 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. The file name is "basics.c" in my test env and can't match the pattern due to "/" in it. Remove "/" from the pattern. gdb/testsuite: 2014-05-14 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): Remove "/" from the pattern. --- 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..eeedc4d 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 ".*${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=\".*${srcfile}\",fullname=\"$fullname_syntax${srcfile}\"\}.*]" \ "Getting a list of source files." } -- 1.9.0