+2014-07-25 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/double-prompt-target-event-error.exp
+ (cancel_pagination_in_target_event): Remove '-notransfer <return>'
+ match.
+ (cancel_pagination_in_target_event): Rework double prompt
+ detection.
+ * gdb.base/paginate-after-ctrl-c-running.exp
+ (test_ctrlc_while_target_running_paginates): Remove '-notransfer
+ <return>' match.
+ * gdb.base/paginate-bg-execution.exp
+ (test_bg_execution_pagination_return)
+ (test_bg_execution_pagination_cancel): Remove '-notransfer
+ <return>' matches.
+ * gdb.base/paginate-execution-startup.exp
+ (test_fg_execution_pagination_return)
+ (test_fg_execution_pagination_cancel): Remove '-notransfer
+ <return>' matches.
+ * gdb.base/paginate-inferior-exit.exp
+ (test_paginate_inferior_exited): Remove '-notransfer <return>'
+ match.
+ * lib/gdb-utils.exp (string_to_regexp): Move here from lib/gdb.exp.
+ * lib/gdb.exp (pagination_prompt): Run text through
+ string_to_regexp.
+ (gdb_test_multiple): Match $pagination_prompt instead of
+ "<return>".
+ (string_to_regexp): Move to lib/gdb-utils.exp.
+
2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/amd64-entry-value-paramref.S: New file.
set saw_continuing 1
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# We're now stopped in a pagination query while handling a
# output.
send_gdb "\003p 1\n"
+ # Note gdb_test_multiple has a default match for the prompt,
+ # which issues a FAIL. Consume the first prompt.
+ set test "first prompt"
+ gdb_test_multiple "" $test {
+ -re "$gdb_prompt" {
+ pass "first prompt"
+ }
+ }
+
+ # We should only see one prompt more, and it should be
+ # preceeded by print's output.
set test "no double prompt"
gdb_test_multiple "" $test {
- -re "$gdb_prompt.*$gdb_prompt.*$gdb_prompt $" {
+ -re "$gdb_prompt.*$gdb_prompt $" {
+ # The bug is present, and expect managed to read
+ # enough characters into the buffer to fill it with
+ # both prompts.
fail $test
}
- -re "$gdb_prompt .* = 1\r\n$gdb_prompt $" {
+ -re " = 1\r\n$gdb_prompt $" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# In case the board file wants to send further commands.
-re "$gdb_prompt $" {
gdb_assert $saw_pagination_prompt $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# Confirm GDB can still process input.
send_gdb "\n"
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an
- # error.
- exp_continue
- }
-re "after sleep\[^\r\n\]+\r\n$" {
gdb_assert $saw_pagination_prompt $test
}
-re "$pagination_prompt$" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
set test "cancel pagination"
send_gdb "\n"
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
-re "$gdb_prompt $" {
gdb_assert $saw_pagination_prompt $test
}
-re "$pagination_prompt$" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
set test "cancel pagination"
set saw_starting 1
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# We're now stopped in a pagination output while handling a
}
return $commands
}
+
+# Given an input string, adds backslashes as needed to create a
+# regexp that will match the string.
+
+proc string_to_regexp {str} {
+ set result $str
+ regsub -all {[]*+.|()^$\[\\]} $str {\\&} result
+ return $result
+}
}
# A regexp that matches the pagination prompt.
-set pagination_prompt "---Type <return> to continue, or q <return> to quit---"
+set pagination_prompt [string_to_regexp "---Type <return> to continue, or q <return> to quit---"]
# The variable fullname_syntax_POSIX is a regexp which matches a POSIX
# absolute path ie. /foo/
#
proc gdb_test_multiple { command message user_code } {
global verbose use_gdb_stub
- global gdb_prompt
+ global gdb_prompt pagination_prompt
global GDB
global inferior_exited_re
upvar timeout timeout
}
set result 1
}
- "<return>" {
+ -re "$pagination_prompt" {
send_gdb "\n"
perror "Window too small."
fail "$message"
}
}
\f
-# Given an input string, adds backslashes as needed to create a
-# regexp that will match the string.
-
-proc string_to_regexp {str} {
- set result $str
- regsub -all {[]*+.|()^$\[\\]} $str {\\&} result
- return $result
-}
# Same as gdb_test, but the second parameter is not a regexp,
# but a string that must match exactly.