From patchwork Tue May 10 10:57:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 12177 Received: (qmail 79315 invoked by alias); 10 May 2016 10:57:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 78237 invoked by uid 89); 10 May 2016 10:57:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=our, perfect X-HELO: mail-pf0-f173.google.com Received: from mail-pf0-f173.google.com (HELO mail-pf0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 10 May 2016 10:57:24 +0000 Received: by mail-pf0-f173.google.com with SMTP id 206so4751476pfu.0 for ; Tue, 10 May 2016 03:57:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=+my6b3LbrEU5mbr3y3rl5bwEZGtVe75ch61HaD5NgHo=; b=k7DgstlT/Hks+Yh2cczzAnqed4Y62wwJTbiaCAZt3zd8F9qjY6xLmxDltT1epCcaTd 9tBkJWFy8yVyPNDVYl5HA5TXH/+bH5wwYH5h/t4a0Ap9HRHc2/4Wl3fbKTb02bQjmph2 RvCk3u4w1YgptuwTj/eWleeJaBsopOOvhTNNsVNcIUZR1+JDxhOwHMoPl00JTPZL9jkB L2WjvgeIBzXsQvc7Focgi73JwI+FETAYNr352uk3BIaFkseZn68d8HXrKPdB94TxKai0 6vow2hQDVkGTAfDuD7Lb4D2DNIGdVZmNsA46x56e5pKPwkgNqiu0jmz6iqH2Ls+sCKNl o6vA== X-Gm-Message-State: AOPr4FUxc+1Yb5AJTeLTfBT6MdPfz2LKwiouQDQBwsQC8R4ERs22nWxpzQdrv5eqUS97SQ== X-Received: by 10.98.94.71 with SMTP id s68mr23085617pfb.43.1462877842074; Tue, 10 May 2016 03:57:22 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc113.osuosl.org. [140.211.9.71]) by smtp.gmail.com with ESMTPSA id o2sm3538770pfi.85.2016.05.10.03.57.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 03:57:20 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Match shell_prompt # in batch-preserve-term-settings.exp Date: Tue, 10 May 2016 11:57:17 +0100 Message-Id: <1462877837-31075-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes batch-preserve-term-settings.exp fails if the shell prompt isn't $. It is # in our testing env. In fact, the shell prompt can be anything. The perfect solution would be "set_board_info shell_prompt" in the host board file, and use board_info shell_prompt in batch-preserve-term-settings.exp. This is a little bit overkill to me, and we still need to figure out the different prompts on different shells. I also tried to start shell with the prompt preset, but there is not unique way to set shell prompt in different shells, so I give up. It is reasonably simple to match either $ or # for the shell prompt, and we can easily extend it to match other char, like >. gdb/testsuite: 2016-05-10 Yao Qi * gdb.base/batch-preserve-term-settings.exp: Remove variable shell_prompt. Update shell_prompt_re. --- gdb/testsuite/gdb.base/batch-preserve-term-settings.exp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp index c925e88..f54a608 100644 --- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp +++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp @@ -28,8 +28,7 @@ if [is_remote host] { } # The shell's prompt. -set shell_prompt "$ " -set shell_prompt_re [string_to_regexp $shell_prompt] +set shell_prompt_re "\[$|#\] " # Spawn shell. Returns true on success, false otherwise.