* [committed][gdb/testsuite] Fix ls_host return in index-cache.exp
@ 2019-05-07 9:58 Tom de Vries
2019-05-07 13:15 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2019-05-07 9:58 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Hi,
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.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix ls_host return in index-cache.exp
gdb/testsuite/ChangeLog:
2019-05-07 Tom de Vries <tdevries@suse.de>
* gdb.base/index-cache.exp (ls_host): Fix return statement.
---
gdb/testsuite/gdb.base/index-cache.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 5baba84360..b76a02b736 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [committed][gdb/testsuite] Fix ls_host return in index-cache.exp
2019-05-07 9:58 [committed][gdb/testsuite] Fix ls_host return in index-cache.exp Tom de Vries
@ 2019-05-07 13:15 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2019-05-07 13:15 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 2019-05-07 5:58 a.m., Tom de Vries wrote:
> Hi,
>
> 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.
>
> Committed to trunk.
>
> Thanks,
> - Tom
>
> [gdb/testsuite] Fix ls_host return in index-cache.exp
>
> gdb/testsuite/ChangeLog:
>
> 2019-05-07 Tom de Vries <tdevries@suse.de>
>
> * gdb.base/index-cache.exp (ls_host): Fix return statement.
>
> ---
> gdb/testsuite/gdb.base/index-cache.exp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
> index 5baba84360..b76a02b736 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
>
Oh, thanks!
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-07 13:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 9:58 [committed][gdb/testsuite] Fix ls_host return in index-cache.exp Tom de Vries
2019-05-07 13:15 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox