From 7bd55dac80c2faced875119b60acfb51741e397e Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 7 May 2019 11:52:17 +0200 Subject: [PATCH] [gdb/testsuite] Fix ls_host return in index-cache.exp When adding a debug print here in index-cache.exp: ... proc_with_prefix test_cache_disabled { cache_dir } { lassign [ls_host $cache_dir] ret files_before + puts "before: '$files_before'" + exit ... we have: ... files_before: '' ... When further adding: ... proc_with_prefix test_cache_disabled { cache_dir } { + exec touch $cache_dir/foo.1 $cache_dir/foo.2 $cache_dir/foo.3 ... we have: ... files_before: 'foo.1' ... while we're expecting file_before to contain foo.[123]. Fix this by making the return statement in ls_host return a list rather than a string (in accordance with the ls_host documentation), after which we have: ... files_before: 'foo.1 foo.2 foo.3' ... Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-05-07 Tom de Vries * gdb.base/index-cache.exp (ls_host): Fix return statement. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/index-cache.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0af0d371f1a..96105794a6d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-05-07 Tom de Vries + + * gdb.base/index-cache.exp (ls_host): Fix return statement. + 2019-05-07 Tom de Vries PR testsuite/24522 diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index 5baba843607..b76a02b7365 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -50,7 +50,7 @@ proc ls_host { dir } { } } - return "0 $filtered" + return [list 0 $filtered] } # Execute "show index-cache stats" and verify the output against expected -- 2.30.2