aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@embecosm.com>2023-02-10 23:49:19 +0000
committerMaciej W. Rozycki <macro@embecosm.com>2023-02-10 23:49:19 +0000
commita2fb245a4b81ffdc93a9c6e9ceddbfb323ac9bec (patch)
tree5b2dd75b0bf48ff07b8fff525278ffd565e1f011 /gdb
parentaaab5fce4f25e0d3b1a85edc7d6ac8f7d06f599c (diff)
downloadgdb-a2fb245a4b81ffdc93a9c6e9ceddbfb323ac9bec.zip
gdb-a2fb245a4b81ffdc93a9c6e9ceddbfb323ac9bec.tar.gz
gdb-a2fb245a4b81ffdc93a9c6e9ceddbfb323ac9bec.tar.bz2
GDB/testsuite: Add `-nonl' option to `gdb_test'
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)
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/lib/gdb.exp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index faa0ac0..b90858a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1395,6 +1395,8 @@ proc gdb_test_multiline { name args } {
# 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,
@@ -1410,6 +1412,7 @@ proc gdb_test { args } {
{no-prompt-anchor}
{lbl}
{nopass}
+ {nonl}
}
lassign $args command pattern message question response
@@ -1424,12 +1427,13 @@ proc gdb_test { args } {
}
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} {