public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 5/8] [gdb/testsuite] Fix timeout in gdb.tui/new-layout.exp
Date: Thu, 13 Apr 2023 16:08:24 +0200	[thread overview]
Message-ID: <20230413140827.19412-6-tdevries@suse.de> (raw)
In-Reply-To: <20230413140827.19412-1-tdevries@suse.de>

In test-case gdb.tui/new-layout.exp we run into:
...
WARNING: timeout in accept_gdb_output
PASS: gdb.tui/new-layout.exp: layout=cmd_only {cmd 1} {} {}: \
  bottom of cmd window is blank
...

The timeout happens here:
...
    Term::command "layout src"
...

Before the "layout src" command we have:
...
Screen Dump (size 80 columns x 24 rows, cursor at column 46, row 7):
    0 +-tui-layout.c-------------------------+(gdb) layout example3
    1 |       20 {                           |(gdb) layout src
    2 |       21   return 0;                 |(gdb) winheight cmd 8
    3 |       22 }                           |(gdb) layout example4
    4 |       23                             |(gdb) layout src
    5 |       24                             |(gdb) winheight cmd 8
    6 |       25                             |(gdb) layout example5
    7 |       26                             |(gdb)
    8 |       27                             |
    9 |       28                             |
   10 |       29                             |
   11 |       30                             |
   12 |       31                             |
   13 |       32                             |
   14 |       33                             |
   15 |       34                             |
   16 |       35                             |
   17 |       36                             |
   18 |       37                             |
   19 |       38                             |
   20 |       39                             |
   21 |       40                             |
   22 +--------------------------------------+
   23 exec No process In:                                                L??   PC: ??
...
and after:
...
Screen Dump (size 80 columns x 24 rows, cursor at column 6, row 16):
    0 +-tui-layout.c-----------------------------------------------------------------+
    1 |       20 {                                                                   |
    2 |       21   return 0;                                                         |
    3 |       22 }                                                                   |
    4 |       23                                                                     |
    5 |       24                                                                     |
    6 |       25                                                                     |
    7 |       26                                                                     |
    8 |       27                                                                     |
    9 |       28                                                                     |
   10 |       29                                                                     |
   11 |       30                                                                     |
   12 |       31                                                                     |
   13 |       32                                                                     |
   14 +------------------------------------------------------------------------------+
   15 exec No process In:                                                L??   PC: ??
   16 (gdb)
   17
   18
   19
   20
   21
   22
   23
...

The Term::command "layout src" is waiting to match:
- "(gdb) layout src", and then
- "(gdb) ".

The first part fails to match on a line:
...
|       26                             |(gdb) layout src
...
because it expects the prompt at the start of the line.

Fix this by allowing the prompt at the start of a window as well.

Tested by x86_64-linux.
---
 gdb/testsuite/lib/tuiterm.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index bb462911046..fa703fc060e 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -850,7 +850,7 @@ namespace eval Term {
 	global gdb_prompt
 	send_gdb "$cmd\n"
 	set str [string_to_regexp $cmd]
-	set str "^$gdb_prompt $str"
+	set str "(^|\|)$gdb_prompt $str"
 	wait_for $str
     }
 
-- 
2.35.3


  parent reply	other threads:[~2023-04-13 14:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 14:08 [PATCH 0/8] [gdb/testsuite] Fix timeouts in TUI tests Tom de Vries
2023-04-13 14:08 ` [PATCH 1/8] [gdb/testsuite] Add warning for timeout in accept_gdb_output Tom de Vries
2023-04-13 14:08 ` [PATCH 2/8] [gdb/testsuite] Add debug prints in Term::wait_for Tom de Vries
2023-04-13 14:08 ` [PATCH 3/8] [gdb/testsuite] Fix timeout in gdb.tui/corefile-run.exp Tom de Vries
2023-04-13 14:08 ` [PATCH 4/8] [gdb/testsuite] Fix timeout in gdb.tui/main.exp Tom de Vries
2023-04-13 14:08 ` Tom de Vries [this message]
2023-04-13 14:08 ` [PATCH 6/8] [gdb/testsuite] Fix timeout in gdb.tui/completion.exp Tom de Vries
2023-04-13 14:08 ` [PATCH 7/8] [gdb/testsuite] Fix timeout in gdb.tui/empty.exp Tom de Vries
2023-04-13 14:08 ` [PATCH 8/8] [gdb/tui] Fix TUI for TERM=ansi Tom de Vries
2023-04-13 14:17   ` Tom de Vries
2023-04-14 11:02     ` Tom de Vries
2023-04-18  6:10       ` Tom de Vries
2023-04-25  7:09         ` Tom de Vries
2023-04-30 11:08           ` Tom de Vries
2023-04-25  6:35 ` [PATCH 0/8] [gdb/testsuite] Fix timeouts in TUI tests Tom de Vries

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=20230413140827.19412-6-tdevries@suse.de \
    --to=tdevries@suse.de \
    --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).