From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Match shell_prompt # in batch-preserve-term-settings.exp
Date: Tue, 10 May 2016 10:57:00 -0000 [thread overview]
Message-ID: <1462877837-31075-1-git-send-email-yao.qi@linaro.org> (raw)
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 <yao.qi@linaro.org>
* 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.
--
1.9.1
next reply other threads:[~2016-05-10 10:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 10:57 Yao Qi [this message]
2016-05-10 11:25 ` Andreas Schwab
2016-05-10 12:02 ` Yao Qi
2016-05-16 16:34 ` Yao Qi
2016-05-18 11:27 ` Pedro Alves
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=1462877837-31075-1-git-send-email-yao.qi@linaro.org \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).