From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 01:56:00 -0000 Message-ID: <1396058002-13704-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00674.txt.bz2 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 } } -- 1.7.7.6