Add a `-nonl' option to `gdb_test' making it possible to match output
from commands such as `output' that do not produce a new line sequence
at the end, e.g.:
(gdb) output 0
0(gdb)
# have any effect if -prompt is specified.
# -lbl specifies that line-by-line matching will be used.
# -nopass specifies that a PASS should not be issued.
+# -nonl specifies that no \r\n sequence is expected between PATTERN
+# and the gdb prompt.
#
# Returns:
# 1 if the test failed,
{no-prompt-anchor}
{lbl}
{nopass}
+ {nonl}
}
lassign $args command pattern message question response
}
set prompt [fill_in_default_prompt $prompt [expr !${no-prompt-anchor}]]
+ set nl [expr ${nonl} ? {""} : {"\[\r\n\]+"}]
set saw_question 0
set user_code {}
lappend user_code {
- -re "\[\r\n\]*(?:$pattern)\[\r\n\]+$prompt" {
+ -re "\[\r\n\]*(?:$pattern)$nl$prompt" {
if { $question != "" & !$saw_question} {
fail $message
} elseif {!$nopass} {