2008-03-18 Jan Kratochvil PR 544 * gdb.cp/annota2.exp, gdb.cp/annota3.exp: Fix a race while recognizing `annotate-quit'. --- ./gdb/testsuite/gdb.cp/annota2.exp 28 Feb 2008 16:24:25 -0000 1.10 +++ ./gdb/testsuite/gdb.cp/annota2.exp 18 Mar 2008 22:41:28 -0000 @@ -205,14 +205,13 @@ gdb_expect { # test: # annotate-quit # -# This test sometimes fails, but not reproducibly. See gdb/544. +# We may get "$gdb_prompt$" earlier as it may get printed several times during +# CTRL-C if we catch its output early enough. # send_gdb "\003" gdb_expect { -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ { pass "annotate-quit" } - -re "$gdb_prompt$" { kfail "gdb/544" "annotate-quit" } - -re ".*$gdb_prompt$" { fail "annotate-quit" } timeout { fail "annotate-quit (timeout)" } } --- ./gdb/testsuite/gdb.cp/annota3.exp 1 Jan 2008 22:53:19 -0000 1.11 +++ ./gdb/testsuite/gdb.cp/annota3.exp 18 Mar 2008 22:41:28 -0000 @@ -208,13 +208,14 @@ gdb_expect { # test: # annotate-quit # -# This test sometimes fails, but not reproducibly. See gdb/544. +# We may get "$gdb_prompt$" earlier as it may get printed several times during +# CTRL-C if we catch its output early enough. # send_gdb "\003" -gdb_expect_list "annotate-quit" "$gdb_prompt$" { - "\r\n\032\032error-begin\r\n" - "Quit\r\n" - "\r\n\032\032quit\r\n" +gdb_expect { + -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ + { pass "annotate-quit" } + timeout { fail "annotate-quit (timeout)" } } #