From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Doug Evans <xdje42@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class
Date: Tue, 08 Jul 2014 18:17:00 -0000 [thread overview]
Message-ID: <20140708181736.GA22667@host2.jankratochvil.net> (raw)
In-Reply-To: <20140708153221.GA15767@host2.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
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
[-- Attachment #2: py-completion-race2.patch --]
[-- Type: text/plain, Size: 1722 bytes --]
--- 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"
}
}
next prev parent reply other threads:[~2014-07-08 18:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 22:49 Sergio Durigan Junior
2014-03-22 2:54 ` Sergio Durigan Junior
2014-04-04 20:41 ` Sergio Durigan Junior
2014-04-10 16:27 ` Tom Tromey
2014-05-03 0:04 ` Sergio Durigan Junior
2014-05-20 19:12 ` Tom Tromey
2014-05-21 2:09 ` Sergio Durigan Junior
2014-05-21 7:48 ` Doug Evans
2014-07-01 0:59 ` Sergio Durigan Junior
2014-07-08 15:32 ` Jan Kratochvil
2014-07-08 18:17 ` Jan Kratochvil [this message]
2014-07-08 20:30 ` Sergio Durigan Junior
2014-08-19 23:02 ` Sergio Durigan Junior
2014-09-02 16:31 ` Sergio Durigan Junior
2014-09-03 4:03 ` Doug Evans
2014-09-03 20:36 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140708181736.GA22667@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
--cc=xdje42@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox