From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wAgJLpjU2F95CgAAWB0awg (envelope-from ) for ; Tue, 15 Dec 2020 10:22:00 -0500 Received: by simark.ca (Postfix, from userid 112) id B683B1F0AA; Tue, 15 Dec 2020 10:22:00 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 236D01E590 for ; Tue, 15 Dec 2020 10:22:00 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A8477386F43F; Tue, 15 Dec 2020 15:21:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8477386F43F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608045719; bh=F916DqwRLDpSkVK1ajdHZ7zxTZ8XXEtrDJWACZN//RM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wu2Gt1juD866nduFrLjEE48FehDNHsAqTRzHTdrqDp7N37VQ8Sza8zuYSLLuMiety VhSgqQZ3ptafnyBZW80SRk3GfaS6zEApsJn+Tk6007uVoBgeY7UoIG1q+gxtRatb9L QYHBPb/VhmQDoLhYPNpZbUuxKobAkOybKof7sHeE= Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id AFA94386F41D for ; Tue, 15 Dec 2020 15:21:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AFA94386F41D Received: by mail-qk1-x732.google.com with SMTP id 19so19400960qkm.8 for ; Tue, 15 Dec 2020 07:21:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F916DqwRLDpSkVK1ajdHZ7zxTZ8XXEtrDJWACZN//RM=; b=BoMfJIj/yt1nvOSCRPRHLN7dyP5vCNuzfgOgmuuBnrvv6IhZ32Bjwv94Q06XP0eyY0 +CUUNNeVzW1t1VLEl788is77SHUhC3Hic4uP4P59l2tpsJ5PTlbRJkOmT1+zD5x2io5s QQgwmbHgqngtydk6ZUkVEH8w6s9aoEcWfjz2bl8N/Yrlgka+3bB/YSYsm5i+srvpP4YG 3dEgyruWglz58WKnFt1mdqO3JGlcE/FtpccsYY6hW7uanY4Eb6GvBjyDEVsWCh429gl3 PZVV2yIh7iRFdRoBNGS9v6cow/OGSmOtHjXC5x8e8UBw0I/DVh6uj+qCiqn7IIk9ZW3L XS/g== X-Gm-Message-State: AOAM532BnpvymDdbt0BJMdHEbteo+G9UckN9y9Qh1uRVp0RtoYvBofwC vUMZoDhfoouTJeJugM6z6CQ93FP4DstJDQ== X-Google-Smtp-Source: ABdhPJz7feOzf7cjYCgQDKOw1ck7pLCf/byXXAcEvGnSFR4vIfcT1NDyCBRxAuy+xSpkkZNKCd+4tQ== X-Received: by 2002:a05:620a:c07:: with SMTP id l7mr9424092qki.182.1608045716059; Tue, 15 Dec 2020 07:21:56 -0800 (PST) Received: from ?IPv6:2804:7f0:8284:370e:2c3a:8c8b:7b6:be51? ([2804:7f0:8284:370e:2c3a:8c8b:7b6:be51]) by smtp.gmail.com with ESMTPSA id s8sm14888055qtw.61.2020.12.15.07.21.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Dec 2020 07:21:55 -0800 (PST) Subject: Re: [PATCH][gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp To: Tom de Vries , gdb-patches@sourceware.org References: <20201214065337.GA3067@delia> <2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org> Message-ID: <6e539558-8e6e-d5db-e2df-05fa0a2d6cc1@linaro.org> Date: Tue, 15 Dec 2020 12:21:53 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" It also times out on Ubuntu 20.04. On 12/15/20 12: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) > 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  >> >>     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 >>       } >>