From: Tom de Vries Date: Fri, 10 Mar 2023 15:34:04 +0000 (+0100) Subject: [gdb/testsuite] Fix gdb.python/py-cmd.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=254de2628f5e6da0c0d48eb86f40ece3d96b7b75;p=binutils-gdb.git [gdb/testsuite] Fix gdb.python/py-cmd.exp [ Using $pp as shorthand for the pagination prompt "--Type for more, q to quit, c to continue without paging--". ] The test-case gdb.python/py-cmd.exp passes, but the handling of the test_multiline command output looks a bit odd: ... (gdb) test_multiline test_multiline output ... test_multiline output $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline q test_multiline Quit (gdb) test_multiline test_multiline output ... test_multiline output $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline: q ... What happens is: - a test_multiline command is issued - some output is printed, followed by a pagination prompt - the test-case concludes that pagination occurred, and produces a PASS - "q\n" is replied to the pagination prompt - without waiting for response to the "q\n", another test_multiline command is issued - in response to the "q\n" we get "Quit\n(gdb) " - some output is printed, followed by a pagination prompt - the test-case concludes that there's a valid response to the "q\n", and produces a PASS, consuming the second pagination prompt, but without a reply. My conclusion is that the second test_multiline command is unintentional, so fix this by removing it. Without it, we have the more straightforward: ... (gdb) test_multiline test_multiline output ... test_multiline output $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline q Quit (gdb) PASS: gdb.python/py-cmd.exp: verify pagination from test_multiline: q ... This also fixes the following warning with target board native-gdbserver: ... WARNING: Timed out waiting for EOF in server after monitor exit ... Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp index 016ea445f10..12b52e4fd61 100644 --- a/gdb/testsuite/gdb.python/py-cmd.exp +++ b/gdb/testsuite/gdb.python/py-cmd.exp @@ -291,7 +291,7 @@ gdb_test_multiple "test_multiline" $test { send_gdb "q\n" set test "verify pagination from test_multiline: q" -gdb_test_multiple "test_multiline" $test { +gdb_test_multiple "" $test { -re "Error occurred in Python" { fail $test }