public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/30288] New: [gdb/cli, editing off] FAIL: gdb.base/trace-commands.exp: nested trace-commands test (pattern 2)
@ 2023-03-29 16:45 vries at gcc dot gnu.org
  2023-03-30  4:14 ` [Bug cli/30288] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2023-03-29 16:45 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-31 15:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 16:45 [Bug cli/30288] New: [gdb/cli, editing off] FAIL: gdb.base/trace-commands.exp: nested trace-commands test (pattern 2) vries at gcc dot gnu.org
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

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).