From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gGU5NG3U2F95CgAAWB0awg (envelope-from ) for ; Tue, 15 Dec 2020 10:21:17 -0500 Received: by simark.ca (Postfix, from userid 112) id C913C1F0AA; Tue, 15 Dec 2020 10:21:17 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 91E621E590 for ; Tue, 15 Dec 2020 10:21:16 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E277384407D; Tue, 15 Dec 2020 15:21:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E277384407D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608045676; bh=1cdqOfN46/Ocih+uB6WUMqVF6EyK1/NUufGoegRSUqE=; 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=lJc4OcbcCadSUDu4P1NSiJEWokkLmmcOWeZ/odgTScijuTpDlMTzf0sxHZEM8jRz3 o8VCQY4LvHx8hFerNmbUYJzcTsnu0zyDcQN1RNgdC1+JlT9tZPOOzDqFsOt8VUHQoJ D7rdwARsY7gw9AlJoQkHR6ywNk5YeY7YC7nUSTHc= Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 5D990386100B for ; Tue, 15 Dec 2020 15:21:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D990386100B Received: by mail-qk1-x72a.google.com with SMTP id d14so18732810qkc.13 for ; Tue, 15 Dec 2020 07:21:11 -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:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1cdqOfN46/Ocih+uB6WUMqVF6EyK1/NUufGoegRSUqE=; b=hHvXULxRt1Xqkp6hxBVuV7zUURjKGhzvZvBCS8H7MKGUR75uz6W/ek/w9OS56TNBeC bxvYJ5WQw8opjfTC9xRx3bHZPUAs/INC3omOXNjqTKtIVMiC0hkNf5FXTZWLw64moME0 XJa9sbKFkiZQYppIqMclDF4MTUo54fQESuenCcgaPoLHr5ZVE2ZWfvYBhmwMHLwA9BAx 1eNuduTdOqck+mELdKDik0iWFomRagVJ5dagiU4OT3XWmecvySdEuACQYpTuMu8OxQhR EYArIRYJhp/NS2CLjwPUeJCcEDtZAfmJ5QIJfMN28yLIRL98zqmSnzHlCy3TGnaRCDGL m6CQ== X-Gm-Message-State: AOAM533dFIuTZOZqgU5qU8z0SBqRKqZLOGv3ItIqiTE5tfglUCkhY0Th IDyCyfCSZHHyYnw4iE7f1c0GIgBB7uFSVw== X-Google-Smtp-Source: ABdhPJz6g8yX6XNn+Vbb/DfcZysupuWJAPzVkaEGu/Q06e3TUnqbSTOqgHXIf2JT+AoVJeEq5gV0kQ== X-Received: by 2002:a37:c92:: with SMTP id 140mr37471027qkm.152.1608045670631; Tue, 15 Dec 2020 07:21:10 -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 l204sm17191308qke.56.2020.12.15.07.21.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Dec 2020 07:21:09 -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> Message-ID: <2fe4a7c6-1965-2184-6583-023f8699dcac@linaro.org> Date: Tue, 15 Dec 2020 12:21:06 -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: <20201214065337.GA3067@delia> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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" 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 > } >