public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug cli/30288] New: [gdb/cli, editing off] FAIL: gdb.base/trace-commands.exp: nested trace-commands test (pattern 2)
Date: Wed, 29 Mar 2023 16:45:29 +0000	[thread overview]
Message-ID: <bug-30288-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30288

            Bug ID: 30288
           Summary: [gdb/cli, editing off] FAIL:
                    gdb.base/trace-commands.exp: nested trace-commands
                    test (pattern 2)
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I wrote a target board that sets editing to off by default, and ran the
testsuite.

With test-case gdb.base/trace-commands.exp, I ran into trouble, with tests that
send several commands at a time, using gdb_test_sequence to match the output.

I did this to get a clear look at what happens (because the output of
gdb_test_sequence confuses me):
...
 # Nested test
+send_gdb "if 1\nset \$i = 0\nwhile \$i < 5\nfunc \$i\nset \$i +=
1\nend\nend\n"
+gdb_test "" ".*" "test"
+exit
+
...

With the default, editing on, I get:
...
(gdb) PASS: gdb.base/trace-commands.exp: simple trace-commands test
if 1
+if 1
 >set $i = 0
 >while $i < 5
  >func $i
  >set $i += 1
  >end
 >end
++set $i = 0
++while $i < 5
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
(gdb) PASS: gdb.base/trace-commands.exp: test
...

With editing off, I get instead:
...
(gdb) PASS: gdb.base/trace-commands.exp: simple trace-commands test
if 1
set $i = 0
while $i < 5
func $i
set $i += 1
end
end
+if 1
 > >  >  >  > >++set $i = 0
++while $i < 5
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
+++func $i
++++echo in func $i\n
in func $i
+++set $i += 1
(gdb) PASS: gdb.base/trace-commands.exp: test
...

If I do an interactive session with editing set to off, and issue one command
at a time, I do see the expected output.

Tentatively marking this as component cli, but perhaps this is a testsuite
issue.

If it's a testsuite issue, we should error out in send_gdb if the command
string contains more than one "\n".

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2023-03-29 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 16:45 vries at gcc dot gnu.org [this message]
2023-03-30  4:14 ` [Bug cli/30288] " vries at gcc dot gnu.org
2023-03-31 14:05 ` [Bug testsuite/30288] " vries at gcc dot gnu.org
2023-03-31 15:15 ` cvs-commit at gcc dot gnu.org
2023-03-31 15:15 ` cvs-commit at gcc dot gnu.org
2023-03-31 15:16 ` vries at gcc dot gnu.org
2023-03-31 15:33 ` vries at gcc dot gnu.org

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=bug-30288-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).