#
# Send a newline character, which will cause GDB to redisplay the
# prompt.
+ #
+ # We then consume the newline characters, and then make use of
+ # expect's -notransfer option to ensure that the prompt has been
+ # displayed, but to leave the prompt in expect's internal buffer.
+ # This is important as the following test wants to check how GDB
+ # displays the 'quit' message relative to the prompt, this is much
+ # easier to do if the prompt is still in expect's buffers.
+ #
+ # The other special thing we do here is avoid printing a 'PASS'
+ # result. The reason for this is so that the GDB output in the
+ # log file will match what a user should see, this makes it much
+ # easier to debug issues. Obviously we could print a 'PASS' here
+ # as the text printed by expect is not considered part of GDB's
+ # output, so the pattern matching will work just fine... but, the
+ # log file becomes much harder to read.
send_gdb "\n"
gdb_test_multiple "" "discard newline" {
-re "^\r\n" {
+ exp_continue
+ }
+ -notransfer -re "^\[^\n\]*$::gdb_prompt $" {
}
}