Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Luis Machado <luis.machado@linaro.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp
Date: Wed, 16 Dec 2020 21:34:09 +0100	[thread overview]
Message-ID: <f4058c25-2743-b605-ab35-d6d9a128b47f@suse.de> (raw)
In-Reply-To: <2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

On 12/15/20 4:21 PM, Luis Machado wrote:
> Ubuntu 18.04 on aarch64 isn't happy about this change.
> 
> I'm getting a number of timeouts now.
> 
> FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: spawn shell
> (timeout)

I could reproduce this on Ubuntu 18.04 x86_64 as well.

> FAIL: gdb.base/batch-preserve-term-settings.exp: cli exit: spawn shell
> (timeout)
> FAIL: gdb.base/batch-preserve-term-settings.exp: cli exit after start
> cmd: spawn shell (timeout)
> FAIL: gdb.base/batch-preserve-term-settings.exp: cli exit after run cmd:
> spawn shell (timeout)
> FAIL: gdb.base/batch-preserve-term-settings.exp: cli exit after SIGTERM:
> spawn shell (timeout)
> 
> All look like this:
> 
> spawn /bin/sh^M
> $ gdb-subshell$
> 
> 

Fixed in patch below, committed.

Thanks,
- Tom



[-- Attachment #2: 0001-gdb-testsuite-Fix-prompt-regexp-in-batch-preserve-term-settings.exp.patch --]
[-- Type: text/x-patch, Size: 1374 bytes --]

[gdb/testsuite] Fix prompt regexp in batch-preserve-term-settings.exp

On openSUSE Leap 15.2, when running test-case
gdb.base/batch-preserve-term-settings.exp I get:
...
spawn /bin/sh^M
PS1="gdb-subshell$ "^M
sh-4.4$ PS1="gdb-subshell$ "^M
gdb-subshell$ PASS: gdb.base/batch-preserve-term-settings.exp: batch run: \
  spawn shell
...
but on Ubuntu 18.04.5, I get instead:
...
spawn /bin/sh^M
PS1="gdb-subshell$ "^M
$ gdb-subshell$ FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: \
  spawn shell (timeout)
...

Fix this by making the regexp recognize the second pattern as well.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-12-16  Tom de Vries  <tdevries@suse.de>

	* gdb.base/batch-preserve-term-settings.exp:

---
 gdb/testsuite/gdb.base/batch-preserve-term-settings.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
index c39d638aeb..3e35d20dd7 100644
--- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
+++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
@@ -47,7 +47,7 @@ proc spawn_shell {} {
     set gotit 0
     set test "spawn shell"
     gdb_expect {
-	-re "PS1=\[^\r\n\]*\r\n$shell_prompt_re$" {
+	-re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" {
 	    pass $test
 	    set gotit 1
 	}

      parent reply	other threads:[~2020-12-16 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14  6:53 Tom de Vries
2020-12-14 15:42 ` Tom Tromey
2020-12-15 15:21 ` Luis Machado via Gdb-patches
2020-12-15 15:21   ` Luis Machado via Gdb-patches
2020-12-16 20:34   ` Tom de Vries [this message]

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=f4058c25-2743-b605-ab35-d6d9a128b47f@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.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