The test in gdb.python/python.exp tests "extended-prompt" and expects
working directory is printed. However, working directory on remote
host doesn't have "gdb/testsuite", so the test fails on remote host
like:
set extended-prompt \w ^M
^M
/home/yao FAIL: gdb.python/python.exp: set extended prompt working directory (timeout)
This patch is to get the working directory first, and use it to match
the output of "set extended-prompt \\w ". It works for remote host
and non remote host.
gdb/testsuite:
2014-11-02 Yao Qi <yao@codesourcery.com>
* gdb.python/python.exp: Get working directory and match the
output of "set extended-prompt \\w " with it.
+2014-11-02 Yao Qi <yao@codesourcery.com>
+
+ * gdb.python/python.exp: Get working directory and match the
+ output of "set extended-prompt \\w " with it.
+
2014-10-30 Doug Evans <dje@google.com>
* gdb.python/py-objfile.exp: Add tests for setting random attributes
}
}
+set working_dir ""
+gdb_test_multiple "pwd" "pwd" {
+ -re "Working directory (.*)\\.\[\r\n\]+$gdb_prompt $" {
+ set working_dir $expect_out(1,string)
+ }
+}
+
gdb_test_multiple "python gdb.prompt_hook = program_prompt" "set the hook" {
-re "\[\r\n\]$gdb_prompt $" {
pass "set programming hook"
gdb_test_multiple "set extended-prompt \\w " \
"set extended prompt working directory" {
- -re "\[\r\n\].*gdb.*testsuite.* $" {
+ -re "\[\r\n\][string_to_regexp $working_dir] $" {
pass "set extended prompt working directory"
}
}