This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] Fix py-parameter.exp for remote host

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
(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.


2014-09-17  Yao Qi  <>

	* gdb.python/py-parameter.exp: Don't match $srcdir/$subdir on
	remote host.
 gdb/testsuite/gdb.python/py-parameter.exp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index 8bc122f..36c109d 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -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" \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]