From patchwork Tue Jul 8 18:17:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 1955 Received: (qmail 10672 invoked by alias); 8 Jul 2014 18:17:50 -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 10640 invoked by uid 89); 8 Jul 2014 18:17:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 08 Jul 2014 18:17:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s68IHgOL017170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jul 2014 14:17:43 -0400 Received: from host2.jankratochvil.net (ovpn-116-54.ams2.redhat.com [10.36.116.54]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s68IHbcO019318 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 8 Jul 2014 14:17:41 -0400 Date: Tue, 8 Jul 2014 20:17:36 +0200 From: Jan Kratochvil To: Sergio Durigan Junior Cc: Doug Evans , gdb-patches@sourceware.org Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class Message-ID: <20140708181736.GA22667@host2.jankratochvil.net> References: <87a9btqhe3.fsf@fleche.redhat.com> <87y4xwqn71.fsf@fleche.redhat.com> <20140708153221.GA15767@host2.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140708153221.GA15767@host2.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Tue, 08 Jul 2014 17:32:21 +0200, Jan Kratochvil wrote: > - -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" { > + -re "^completefilecommandcond ${completion_regex}$" { There was a racy bug here - and even in the former test - here should be: + -re "^completefilecommandcond ${completion_regex}\007$" { Updated fix attached. Jan --- gdb.python/py-completion.exp-orig 2014-07-07 21:32:17.891045058 +0200 +++ gdb.python/py-completion.exp 2014-07-08 20:14:57.189791928 +0200 @@ -26,9 +26,9 @@ if { [skip_python_tests] } { continue } gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" # Create a temporary directory -set testdir "${objdir}/${subdir}/py-completion-testdir/" +set testdir "[standard_output_file "py-completion-testdir"]/" set testdir_regex [string_to_regexp $testdir] -set testdir_complete "${objdir}/${subdir}/py-completion-test" +set testdir_complete [standard_output_file "py-completion-test"] file mkdir $testdir # This one should always pass. @@ -40,8 +40,7 @@ gdb_test_multiple "" "completefileinit c } # Just discarding whatever we typed. -send_gdb "\n" -gdb_test "print" ".*" +gdb_test " " ".*" "discard #1" # This is the problematic one. send_gdb "completefilemethod ${testdir_complete}\t" @@ -55,16 +54,16 @@ gdb_test_multiple "" "completefilemethod } # Discarding again -send_gdb "\n" -gdb_test "print" ".*" +gdb_test " " ".*" "discard #2" # Another problematic -send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t" +set completion_regex "[string_to_regexp [standard_output_file "py-completion-t"]]" +send_gdb "completefilecommandcond [standard_output_file "py-completion-t\t"]" gdb_test_multiple "" "completefilecommandcond completion" { -re "^completefilecommandcond ${testdir}$" { fail "completefilecommandcond completion (completed filename instead of command)" } - -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" { + -re "^completefilecommandcond ${completion_regex}\007$" { pass "completefilecommandcond completion" } }