Fix py-parameter.exp for remote host
authorYao Qi <yao@codesourcery.com>
Mon, 15 Sep 2014 11:06:22 +0000 (19:06 +0800)
committerYao Qi <yao@codesourcery.com>
Wed, 15 Oct 2014 07:33:24 +0000 (15:33 +0800)
Test gdb.python/py-parameter.exp expects output "$srcdir/$subdir:\$cdir:\$cwd",
but proc gdb_reinitialize_dir doesn't set $srcdir/$subdir in search
directories on remote host because it doesn't exist on remote host.

proc gdb_reinitialize_dir { subdir } {
    global gdb_prompt

    if [is_remote host] {
return ""
    }

It causes the fail below:

(gdb) python print (gdb.parameter ('directories'))^M
/tmp/gdb:$cdir:$cwd^M
(gdb) FAIL: gdb.python/py-parameter.exp: python print (gdb.parameter ('directories'))

This patch is to fix this fail by not matching $srcdir/$subdir on remote host.

gdb/testsuite:

2014-10-15  Yao Qi  <yao@codesourcery.com>

* gdb.python/py-parameter.exp: Don't match $srcdir/$subdir on
remote host.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-parameter.exp

index fd8898c7ba4da59c6c3dc3bfb36f4e81a10a9c36..68ab5fbe466aa7cec193f8f9b61fb74c5981073b 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-15  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.python/py-parameter.exp: Don't match $srcdir/$subdir on
+       remote host.
+
 2014-10-15  Yao Qi  <yao@codesourcery.com>
 
        * gdb.python/py-symbol.exp: Match file base name if host is
index 8bc122f7f76371b0021ff63dd49fde180db50a62..36c109dc4f45ce5edea93fd99ec7324777e3ab4a 100644 (file)
@@ -27,7 +27,14 @@ gdb_reinitialize_dir $srcdir/$subdir
 if { [skip_python_tests] } { continue }
 
 # We use "." here instead of ":" so that this works on win32 too.
-gdb_test "python print (gdb.parameter ('directories'))" "$srcdir/$subdir.\\\$cdir.\\\$cwd"
+if { [is_remote host] } {
+    # Don't match $srcdir/$subdir because proc gdb_reinitialize_dir
+    # doesn't set search directories on remote host.
+    set directories ".*\\\$cdir.\\\$cwd"
+} else {
+    set directories "$srcdir/$subdir.\\\$cdir.\\\$cwd"
+}
+gdb_test "python print (gdb.parameter ('directories'))" $directories
 
 # Test a simple boolean parameter.
 gdb_py_test_multiple "Simple gdb booleanparameter" \
This page took 0.030219 seconds and 4 git commands to generate.