|
|
f9426a |
http://sourceware.org/ml/gdb-patches/2014-07/msg00154.html
|
|
|
f9426a |
Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class
|
|
|
f9426a |
|
|
|
f9426a |
|
|
|
f9426a |
--pWyiEgJYm5f9v55/
|
|
|
f9426a |
Content-Type: text/plain; charset=us-ascii
|
|
|
f9426a |
Content-Disposition: inline
|
|
|
f9426a |
|
|
|
f9426a |
On Tue, 08 Jul 2014 17:32:21 +0200, Jan Kratochvil wrote:
|
|
|
f9426a |
> - -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" {
|
|
|
f9426a |
> + -re "^completefilecommandcond ${completion_regex}$" {
|
|
|
f9426a |
|
|
|
f9426a |
There was a racy bug here - and even in the former test - here should be:
|
|
|
f9426a |
+ -re "^completefilecommandcond ${completion_regex}\007$" {
|
|
|
f9426a |
|
|
|
f9426a |
Updated fix attached.
|
|
|
f9426a |
|
|
|
f9426a |
|
|
|
f9426a |
Jan
|
|
|
f9426a |
|
|
|
f9426a |
--pWyiEgJYm5f9v55/
|
|
|
f9426a |
Content-Type: text/plain; charset=us-ascii
|
|
|
f9426a |
Content-Disposition: inline; filename="py-completion-race2.patch"
|
|
|
f9426a |
|
|
|
f9426a |
--- ./gdb/testsuite/gdb.python/py-completion.exp-orig 2014-07-07 21:32:17.891045058 +0200
|
|
|
f9426a |
+++ ./gdb/testsuite/gdb.python/py-completion.exp 2014-07-08 20:14:57.189791928 +0200
|
|
|
f9426a |
@@ -26,9 +26,9 @@ if { [skip_python_tests] } { continue }
|
|
|
f9426a |
gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py"
|
|
|
f9426a |
|
|
|
f9426a |
# Create a temporary directory
|
|
|
f9426a |
-set testdir "${objdir}/${subdir}/py-completion-testdir/"
|
|
|
f9426a |
+set testdir "[standard_output_file "py-completion-testdir"]/"
|
|
|
f9426a |
set testdir_regex [string_to_regexp $testdir]
|
|
|
f9426a |
-set testdir_complete "${objdir}/${subdir}/py-completion-test"
|
|
|
f9426a |
+set testdir_complete [standard_output_file "py-completion-test"]
|
|
|
f9426a |
file mkdir $testdir
|
|
|
f9426a |
|
|
|
f9426a |
# This one should always pass.
|
|
|
f9426a |
@@ -40,8 +40,7 @@ gdb_test_multiple "" "completefileinit c
|
|
|
f9426a |
}
|
|
|
f9426a |
|
|
|
f9426a |
# Just discarding whatever we typed.
|
|
|
f9426a |
-send_gdb "\n"
|
|
|
f9426a |
-gdb_test "print" ".*"
|
|
|
f9426a |
+gdb_test " " ".*" "discard #1"
|
|
|
f9426a |
|
|
|
f9426a |
# This is the problematic one.
|
|
|
f9426a |
send_gdb "completefilemethod ${testdir_complete}\t"
|
|
|
f9426a |
@@ -55,16 +54,16 @@ gdb_test_multiple "" "completefilemethod
|
|
|
f9426a |
}
|
|
|
f9426a |
|
|
|
f9426a |
# Discarding again
|
|
|
f9426a |
-send_gdb "\n"
|
|
|
f9426a |
-gdb_test "print" ".*"
|
|
|
f9426a |
+gdb_test " " ".*" "discard #2"
|
|
|
f9426a |
|
|
|
f9426a |
# Another problematic
|
|
|
f9426a |
-send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t"
|
|
|
f9426a |
+set completion_regex "[string_to_regexp [standard_output_file "py-completion-t"]]"
|
|
|
f9426a |
+send_gdb "completefilecommandcond [standard_output_file "py-completion-t\t"]"
|
|
|
f9426a |
gdb_test_multiple "" "completefilecommandcond completion" {
|
|
|
f9426a |
-re "^completefilecommandcond ${testdir}$" {
|
|
|
f9426a |
fail "completefilecommandcond completion (completed filename instead of command)"
|
|
|
f9426a |
}
|
|
|
f9426a |
- -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" {
|
|
|
f9426a |
+ -re "^completefilecommandcond ${completion_regex}\007$" {
|
|
|
f9426a |
pass "completefilecommandcond completion"
|
|
|
f9426a |
}
|
|
|
f9426a |
}
|
|
|
f9426a |
|
|
|
f9426a |
--pWyiEgJYm5f9v55/--
|
|
|
f9426a |
|