Re: [PATCH v4 8/9] gdb/testsuite: support passing inferior arguments with native-gdbserver board

Simon Marchi
2020-05-19T17:11:51Z

On 2020-05-15 1:29 p.m., Tom de Vries wrote:
> The curly braces are what you get when you directly convert a list of
> strings into a string.
>
> If we do the conversion ourselves, we get the desired outcome:
> ...
> $ cat test.tcl
> #!/usr/bin/tclsh
>
> set args [list hello "with spaces" world]
>
> proc string_list_to_string_with_quotes { args } {
> set s ""
> foreach arg $args {
> set s "$s \"$arg\""
> }
> return $s
> }
>
> set args_str [string_list_to_string_with_quotes {*}$args]
> puts "run $args_str"
> $ ./test.tcl
> run "hello" "with spaces" "world"
> ...
>
> And we can use the normal "args" rather than the inferior_args, as long
> as we take care to pass the args from one varargs function to another
> using '{*}$args'.

I'm fine with both ways, do you have a preference?

Simon