Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp
Date: Tue, 15 Dec 2020 12:21:06 -0300	[thread overview]
Message-ID: <2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org> (raw)
In-Reply-To: <20201214065337.GA3067@delia>

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


On 12/14/20 3:53 AM, Tom de Vries wrote:
> Hi,
> 
> On SLE-11, I run into:
> ...
> FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: spawn shell \
>    (timeout)
> ...
> 
> The problem is that the shell prompt has PS1="\h:\w> ", but the test expects
> a shell prompt ending in a space preceded by either '$' or '#':
> ...
> set shell_prompt_re "\[$#\] "
> ...
> 
> We could easily fix this by adding '>' to shell_prompt_re, but this wouldn't
> work for other PS1 setting.
> 
> Fix this instead by setting the shell prompt to "gdb-subshell$ " (as in
> gdb.base/multi-line-starts-subshell.exp).
> 
> Tested on x86_64-linux.
> 
> Any comments?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp
> 
> gdb/testsuite/ChangeLog:
> 
> 2020-12-14  Tom de Vries  <tdevries@suse.de>
> 
> 	PR testsuite/26951
> 	* gdb.base/batch-preserve-term-settings.exp: Use "gdb-subshell$ " as
> 	shell prompt.
> 
> ---
>   gdb/testsuite/gdb.base/batch-preserve-term-settings.exp | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
> index 7ae3518beb..c39d638aeb 100644
> --- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
> +++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
> @@ -28,12 +28,13 @@ if [is_remote host] {
>   }
>   
>   # The shell's prompt.
> -set shell_prompt_re "\[$#\] "
> +set shell_prompt_ps1 "gdb-subshell$ "
> +set shell_prompt_re [string_to_regexp $shell_prompt_ps1]
>   
>   # Spawn shell.  Returns true on success, false otherwise.
>   
>   proc spawn_shell {} {
> -    global shell_prompt_re
> +    global shell_prompt_ps1 shell_prompt_re
>   
>       set res [remote_spawn host "/bin/sh"]
>       if { $res < 0 || $res == "" } {
> @@ -41,10 +42,12 @@ proc spawn_shell {} {
>   	return 0
>       }
>   
> +    send_gdb "PS1=\"$shell_prompt_ps1\"\n"
> +
>       set gotit 0
>       set test "spawn shell"
>       gdb_expect {
> -	-re "$shell_prompt_re$" {
> +	-re "PS1=\[^\r\n\]*\r\n$shell_prompt_re$" {
>   	    pass $test
>   	    set gotit 1
>   	}
> 

  parent reply	other threads:[~2020-12-15 15:21 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 [this message]
2020-12-15 15:21   ` Luis Machado via Gdb-patches
2020-12-16 20:34   ` 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=2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org \
    --to=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=tdevries@suse.de \
    /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