aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-01-03 21:13:52 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-01-09 10:34:24 +0000
commitd820d0c37beda1c29ff50bb1f2ebc1d23114d735 (patch)
treed1c461d032a635b08dcfae7ecd26f0f847594b60 /gdb
parent1055a3b422da11b252fc83e73a5e9f465233e73d (diff)
downloadgdb-d820d0c37beda1c29ff50bb1f2ebc1d23114d735.zip
gdb-d820d0c37beda1c29ff50bb1f2ebc1d23114d735.tar.gz
gdb-d820d0c37beda1c29ff50bb1f2ebc1d23114d735.tar.bz2
gdb/testsuite: Remove interactive prompt case from mi_gdb_test
I noticed that when running this test: make check-gdb RUNTESTFLAGS="--target_board=native-gdbserver gdb.mi/mi-break.exp" I would occasionally see some UNRESOLVED test results like this: (gdb) PASS: gdb.mi/mi-break.exp: mi-mode=separate: breakpoint at main Expecting: ^(kill[ ]+)?(.*[ ]+[(]gdb[)] [ ]*) kill &"kill\n" ~"Kill the program being debugged? (y or n) [answered Y; input not from terminal]\n" =thread-group-exited,id="i1" ERROR: Got interactive prompt. UNRESOLVED: gdb.mi/mi-break.exp: mi-mode=separate: The problem appears to be that the expect buffer fills up to include the '(y or n)' prompt without including the following lines. The pattern supplied by the outer test script is looking for the following lines. As the following lines are not present then expect matches on the interactive prompt case rather than the case for the user supplied pattern. The problem with this is that we are not really at an interactive prompt, GDB is providing an answer for us and then moving on. When I examine a successful run of the test the output from GDB is identical, the only difference is where expect happens to buffer the output from GDB. This patch remove all special handling of the interactive prompt case. This means that if we ever break GDB and start seeing an unexpected interactive prompt then tests will rely on a timeout to fail, instead of having dedicated interactive prompt detection, but this solves the problem that an auto-answered prompt looks very similar to an interactive prompt. With this patch in place I can now leave the following loop running indefinitely, where before it would fail usually after ~10 iterations. while make check-gdb RUNTESTFLAGS="--target_board=native-gdbserver gdb.mi/mi-break.exp"; \ do /bin/true; \ done gdb/testsuite/ChangeLog: * lib/mi-support.exp (mi_gdb_test): Remove interactive prompt case.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/mi-support.exp5
2 files changed, 5 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3f7d72c..309cfb5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-09 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * lib/mi-support.exp (mi_gdb_test): Remove interactive prompt
+ case.
+
2019-01-06 Tom Tromey <tom@tromey.com>
PR gdb/28155:
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index d193592..a58c4f6 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -833,11 +833,6 @@ proc mi_gdb_test { args } {
perror "Window too small."
fail "$message"
}
- -re "\\(y or n\\) " {
- send_gdb "n\n"
- perror "Got interactive prompt."
- fail "$message"
- }
eof {
perror "Process no longer exists"
if { $message != "" } {