[gdb/testsuite] Fix ls_host return in index-cache.exp
authorTom de Vries <tdevries@suse.de>
Tue, 7 May 2019 09:52:17 +0000 (11:52 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 7 May 2019 09:52:17 +0000 (11:52 +0200)
commit7bd55dac80c2faced875119b60acfb51741e397e
tree28a7cd83b54dd30fcbb68fc0f96fb03ec5133cb1
parent75f06e9dc59d3f810e2afe2f47afbcb74204ef61
[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  <tdevries@suse.de>

* gdb.base/index-cache.exp (ls_host): Fix return statement.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/index-cache.exp
This page took 0.02532 seconds and 4 git commands to generate.