public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>, Tom Tromey <tom@tromey.com>,
	 Richard Bunt <Richard.Bunt@arm.com>
Subject: [PATCH v4 5/6] GDB/testsuite: Add `-nonl' option to `gdb_test'
Date: Fri, 10 Feb 2023 14:19:42 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.20.2302100125150.7841@tpp.orcam.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.20.2302092205020.7841@tpp.orcam.me.uk>

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)
---
No change from v3.

No change from v2.

New change in v2.
---
 gdb/testsuite/lib/gdb.exp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

gdb-test-nonl.diff
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp
+++ src/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} {

  parent reply	other threads:[~2023-02-10 14:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 14:18 [PATCH v4 0/6] gdb: introduce limited array lengths while printing values Maciej W. Rozycki
2023-02-10 14:19 ` [PATCH v4 1/6] GDB: Switch to using C++ standard integer type limits Maciej W. Rozycki
2023-02-10 21:13   ` Tom Tromey
2023-02-10 14:19 ` [PATCH v4 2/6] GDB: Ignore `max-value-size' setting with value history accesses Maciej W. Rozycki
2023-02-10 14:19 ` [PATCH v4 3/6] GDB: Fix the mess with value byte/bit range types Maciej W. Rozycki
2023-02-10 14:19 ` [PATCH v4 4/6] GDB: Only make data actually retrieved into value history available Maciej W. Rozycki
2023-02-10 21:16   ` Tom Tromey
2023-02-10 14:19 ` Maciej W. Rozycki [this message]
2023-02-10 14:19 ` [PATCH v4 6/6] GDB: Introduce limited array lengths while printing values Maciej W. Rozycki
2023-02-13 14:45   ` Simon Marchi
2023-02-14 19:20     ` Maciej W. Rozycki
2023-02-23 21:16       ` Maciej W. Rozycki
2023-02-10 21:17 ` [PATCH v4 0/6] gdb: introduce " Tom Tromey
2023-02-10 23:50   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.2302100125150.7841@tpp.orcam.me.uk \
    --to=macro@embecosm.com \
    --cc=Richard.Bunt@arm.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).