From patchwork Tue May 13 07:34:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 882 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id E7E703600FE for ; Tue, 13 May 2014 00:37:40 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id 9C1896360D026; Tue, 13 May 2014 00:37:40 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.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-mx23.g.dreamhost.com (Postfix) with ESMTPS id 7E9D46360D01E for ; Tue, 13 May 2014 00:37:40 -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:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=j3QlRKqYUEyquXIKMeWp9WvEhZKEG eSsd02oaxbqmGy3w3Z1SV24fOfl7nwKBsV5obHTqXJnNn81pTIjdi81aWRjqekzw yzPUVB/Gd7NaTG7wtzkiRJFtPMluFFV/qggXHq7DctL5DWSfDgklrXtw//FCCP+t 2oyEY3UuoSeU8k= 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:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=IZyDgY5XVS7zQvl93AFX8kfJIdA=; b=ati K+S3J1F7YQc/k0yw/1LAt/w7vA/f4KmzmXun6DOWkW/E2hjE+uZR0QGq9ruMN0c4 qFZ3+OO6BbNjSxZo+aoV4FFzlyvDKdFEtBYqZmNAUPcbQzQtCxQ5RV6t7puBOjHn 0qDXyJALJhjGTTlA0ZpuwlP4CeCcjDVQv2CAcCyw= 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-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 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 15:34:34 +0800 Message-ID: <1399966474-6106-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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." }