From patchwork Wed May 14 02:20:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 899 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id 1D6EE360098 for ; Tue, 13 May 2014 19:22:58 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id BFD4E166AE79; Tue, 13 May 2014 19:22:57 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 8C02D1665180 for ; Tue, 13 May 2014 19:22:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=kpes8Ev1BXov4i0TW4IM8qGHvr/yYsDZaL4OjFHDfbn duayXOeJ+dxK0EQnKkFfaHQdh8wiocj44LY2W2vOZKuHEEZqMBpyIPSgxyHa7Ofj /k2mArY4JzcL2tU7DWhdC77czwz8Y1cZENGiap7v+IxpkPriS/2pJBEqOtrM7KTQ = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=nNrPeUtHMCQ51V0EfNejiFo+oeQ=; b=GmVJvNhj5EqaLIvrP lwL3bGfXhn5au54pQsrU+hRq7JMTCRjDJj8/v+ug2cGznSi43BOVrElIU4Yl9YlX 8pAP8+EVxuYDf6Kb7RdN+d857hSY/ikQfJQ/Su3tT0v3/il/kfpaUPbVXFYszLEs c8/YbPjw6yfPhY5HAkoPFbdLZw= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@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 10:20:06 +0800 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> X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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. 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." }