Re: [committed][gdb/testsuite] Don't leak tuiterm.exp spawn override

Tom de Vries
2020-06-17T14:55:52Z

On 6/15/20 9:46 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
>>> There was a report recently about gdb overrides like this breaking
>>> with a newer dejagnu.
>
> Tom> You're referring to this (
> Tom> https://sourceware.org/pipermail/gdb/2020-June/048689.html ) ?
>
> Yeah.
>
> Tom> Now the idiom is:
> Tom> ...
> Tom> -load_lib tuiterm.exp
> Tom> +tuiterm_env
> Tom> ...
>
> Looks good, thanks.
>
> Tom> I've also tried wrapping the test-case body using the tuiterm_env proc,
> Tom> like this:
> Tom> ...
> Tom> tuiterm_env {
> Tom> ...
> Tom> }
> Tom> ...
> Tom> but ran into curly-braces trouble in gdb.tui/new-layout.exp.
>
> Very unexpected.

That's essentially:
...
$ cat ./test.tcl
#!/usr/bin/tclsh

puts "1: {"

proc do_this { body } {
return [uplevel 1 $body]
}

do_this {
puts "2: {"
}
...
and:
...
$ ./test.tcl
1: {
missing close-brace
while executing
"do_this {"
(file "./test.tcl" line 9)
...

Thanks,
- Tom