From patchwork Thu Oct 30 02:46:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3498 Received: (qmail 12391 invoked by alias); 30 Oct 2014 02:51:09 -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 12366 invoked by uid 89); 30 Oct 2014 02:51:03 -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, RCVD_IN_DNSWL_NONE 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; Thu, 30 Oct 2014 02:51:01 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1XjfpB-00047y-Hn from Yao_Qi@mentor.com ; Wed, 29 Oct 2014 19:50:57 -0700 Received: from GreenOnly (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.181.6; Wed, 29 Oct 2014 19:50:56 -0700 From: Yao Qi To: Pedro Alves CC: Subject: Re: [PATCH] Match the working directory on remote host References: <1413466760-25886-1-git-send-email-yao@codesourcery.com> <5440071B.2040801@redhat.com> Date: Thu, 30 Oct 2014 10:46:20 +0800 In-Reply-To: <5440071B.2040801@redhat.com> (Pedro Alves's message of "Thu, 16 Oct 2014 18:57:47 +0100") Message-ID: <87oasus29v.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Pedro Alves writes: > Looks good. > >> gdb_test_multiple "set extended-prompt \\w " \ >> "set extended prompt working directory" { >> - -re "\[\r\n\].*gdb.*testsuite.* $" { >> + -re "\[\r\n\]${working_dir} $" { > > Please don't change the indentation though. OK, fixed. I also update the patch to use string_to_regexp to escape backslash in windows path, otherwise, we'll get the following error on testing mingw32 host gdb, 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 I'll commit it tomorrow. diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 0e77256..787a294 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -314,6 +314,13 @@ gdb_test_multiple "set prompt $gdb_prompt " "set default prompt" { } } +set working_dir "" +gdb_test_multiple "pwd" "pwd" { + -re "Working directory (.*)\\.\[\r\n\]+$gdb_prompt $" { + set working_dir $expect_out(1,string) + } +} + gdb_test_multiple "python gdb.prompt_hook = program_prompt" "set the hook" { -re "\[\r\n\]$gdb_prompt $" { pass "set programming hook" @@ -346,7 +353,7 @@ gdb_test_multiple "set extended-prompt one two three " \ gdb_test_multiple "set extended-prompt \\w " \ "set extended prompt working directory" { - -re "\[\r\n\].*gdb.*testsuite.* $" { + -re "\[\r\n\][string_to_regexp $working_dir] $" { pass "set extended prompt working directory" } }