From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84239 invoked by alias); 10 May 2016 12:02:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 84225 invoked by uid 89); 10 May 2016 12:02:24 -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=HX-Received:10.98.72.16, our, perfect X-HELO: mail-pf0-f169.google.com Received: from mail-pf0-f169.google.com (HELO mail-pf0-f169.google.com) (209.85.192.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 10 May 2016 12:02:14 +0000 Received: by mail-pf0-f169.google.com with SMTP id y69so5263004pfb.1 for ; Tue, 10 May 2016 05:02:14 -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:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=iE6hmvVF2Yx+HdFzNuQm8CFcHKFoGf0y+iLON3PoQmI=; b=ZafT5nC+B3VF4H8GiQicBHATPCuakG7olLKU0YzTuEvvmEPb+K16Az6f/MpZrjsid7 O+kc6lqTUY3Vz2+tCvj710vqZemdEI7IvXVyKk9OK3DsghB7HrqX99J84OmELO//2q1q Da6osacXzCvaye8Sqnr8yiAhpSxlPuPdjMYH5359gynbE7pxvpUC5JqJliddDSm6250m DwZYlJnrWWh63liD/ur8OWPgkwUiVN+zAo9viQGL8WkU0TpMkGaGn8V20510qmUyHIzd HWjAlfC6ebfNbgI7pSdt1ogKUCd3oAJRn0Ydd60q/bEECXVBG/6YKJojeyfsfoFOfdbc tdtQ== X-Gm-Message-State: AOPr4FUSCCB+pIDkE5uDXXscfittmSkKzMA8qoWXGut/tAbvl4ECc1xQY0B79AHnDYD8iQ== X-Received: by 10.98.72.16 with SMTP id v16mr58274210pfa.12.1462881732935; Tue, 10 May 2016 05:02:12 -0700 (PDT) Received: from E107787-LIN (gcc113.osuosl.org. [140.211.9.71]) by smtp.gmail.com with ESMTPSA id 7sm4051706pfe.88.2016.05.10.05.02.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 May 2016 05:02:11 -0700 (PDT) From: Yao Qi To: Andreas Schwab Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Match shell_prompt # in batch-preserve-term-settings.exp References: <1462877837-31075-1-git-send-email-yao.qi@linaro.org> Date: Tue, 10 May 2016 12:02:00 -0000 In-Reply-To: (Andreas Schwab's message of "Tue, 10 May 2016 13:25:39 +0200") Message-ID: <86inymdsu8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00165.txt.bz2 Andreas Schwab writes: >> # The shell's prompt. >> -set shell_prompt "$ " >> -set shell_prompt_re [string_to_regexp $shell_prompt] >> +set shell_prompt_re "\[$|#\] " > > Did you intent to match "|" too? Ur, no, that is not intended. "|" should be removed from shell_prompt_re. --=20 Yao (=E9=BD=90=E5=B0=A7) Subject: [PATCH] Match shell_prompt # in batch-preserve-term-settings.exp 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. diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/= testsuite/gdb.base/batch-preserve-term-settings.exp index c925e88..a2de2c0 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] { } =20 # The shell's prompt. -set shell_prompt "$ " -set shell_prompt_re [string_to_regexp $shell_prompt] +set shell_prompt_re "\[$#\] " =20 # Spawn shell. Returns true on success, false otherwise. =20