From patchwork Sat Mar 29 01:53:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 343 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 40AE3360210 for ; Fri, 28 Mar 2014 18:56:14 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 0453FC5E639; Fri, 28 Mar 2014 18:56:13 -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 95539CA613C for ; Fri, 28 Mar 2014 18:56:12 -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=dzcGx0K3u8I6tAcsQm7cCYFvAs941 3J8+MTsTAQX2R4fgPRlZqwZ39rhLCZKI7Bl0ayujqDSpLAfl/SPVA31EoRX8KHYU +P09bHBTpXbR5DD/NP0nYfUAOm5BAoRDjqpR7jt5zBTNAnN5bB4SFCeSmA/SaMke qYun18LmHpgang= 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=PTr0FOTm1cpJ2sJb5NICbq9I038=; b=kDA 8vfs16o42CNX4zPKSgolDY3t/rvZr/rWbDuSEd2GWQQi4vDfwCpyKArHMNMEdW0s ajnvWtqxv5MxfoGdowdAxY5OFJ2JWVDIsfi1RDh9N1v6rhTyVp+SKFl0I+lu7lDF 4Fb38NKnDvnNSk7LdJpbUYpjnvj4yi5YMCqK75qs= Received: (qmail 23130 invoked by alias); 29 Mar 2014 01:56:10 -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 22918 invoked by uid 89); 29 Mar 2014 01:56:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 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; Sat, 29 Mar 2014 01:56:08 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WTiVB-0002T3-3N from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 28 Mar 2014 18:56:05 -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); Fri, 28 Mar 2014 18:56:04 -0700 Received: from qiyao.dyndns.org.com (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; Fri, 28 Mar 2014 18:56:03 -0700 From: Yao Qi To: Subject: [PATCH] Escape backslash in windows path Date: Sat, 29 Mar 2014 09:53:22 +0800 Message-ID: <1396058002-13704-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi, On windows host, we see the following ERROR, (gdb) PASS: gdb.base/setshow.exp: set history filename ~/foobar.baz ERROR OCCURED: couldn't compile regular expression pattern: invalid escape \ sequence while executing "expect -nobrace -i exp13 -timeout 10 -re {.*A problem internal to GDB has been detected} { fail "$message (GDB internal error)" gdb_internal..." invoked from within "expect { -i exp13 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_erro..." ("uplevel" body line 1) invoked from within "uplevel $body" REGEXP REG_EESCAPE {invalid escape \ sequence} couldn't compile regular expression pattern: invalid escape \ sequenceERROR: Process no longer exists which leads to UNRESOLVED: gdb.base/setshow.exp: show history filename (~/foobar.baz) and this error is thrown from this test below: gdb_test "show history filename" \ "The filename in which to record the command history is \"$HOME/foobar.baz\"..*" \ "show history filename (~/foobar.baz)" HOME is a windows path, like C:\foo\bar. When it is used in gdb_test to match output, the error is thrown because backslash is a special character in regular expression. This patch is to escape backslash to fix this error. This patch is obvious to me, and I'll commit it in a few days. gdb/testsuite: 2014-03-29 Yao Qi * gdb.base/setshow.exp: Escape backslash in HOME and PWD. --- gdb/testsuite/gdb.base/setshow.exp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 13da410..0feb729 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -171,6 +171,8 @@ set test "show environment HOME" gdb_test_multiple $test $test { -re "\nHOME = (\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" { set HOME $expect_out(1,string) + # Escape backslash in case HOME is a windows path. + regsub -all {\\} $HOME {\\\\} HOME pass $test } } @@ -187,6 +189,8 @@ set test "show working directory" gdb_test_multiple "pwd" $test { -re "\nWorking directory (\[^\r\n\]*)\\.\[\r\n\]+$gdb_prompt $" { set PWD $expect_out(1,string) + # Escape backslash in case PWD is a windows path. + regsub -all {\\} $PWD {\\\\} PWD pass $test } }