[ was: Re: [PATCH 3/3][gdb/testsuite] Warn about leaked global array ] On 04-06-2020 14:29, Tom de Vries wrote: > On 04-06-2020 13:16, Pedro Alves wrote: >> On 6/3/20 4:35 PM, Tom de Vries wrote: >>> @@ -47,6 +47,10 @@ proc pascal_init {} { >>> set pascal_compiler_is_fpc 0 >>> set gpc_compiler [transform gpc] >>> set fpc_compiler [transform fpc] >>> + gdb_persistent_global pascal_compiler_is_gpc >>> + gdb_persistent_global pascal_compiler_is_fpc >>> + gdb_persistent_global gpc_compiler >>> + gdb_persistent_global fpc_compiler >> >>> @@ -47,6 +47,10 @@ proc pascal_init {} { >>> set pascal_compiler_is_fpc 0 >>> set gpc_compiler [transform gpc] >>> set fpc_compiler [transform fpc] >>> + gdb_persistent_global pascal_compiler_is_gpc >>> + gdb_persistent_global pascal_compiler_is_fpc >>> + gdb_persistent_global gpc_compiler >>> + gdb_persistent_global fpc_compiler >> >> Can we make gdb_persistent_global proc also do the "global $var" >> in the caller's scope, so that it could be used to replace >> the "global" statement? With that, you would only have to declare >> the variable once, and this hunk here would instead be: > > Done, currently re-testing. Rebased on current trunk and re-tested. Committed as attached below. Also, I dropped the tuiterm.exp bit, it's no longer necessary since commit 8c74a764f2 "[gdb/testsuite] Don't leak tuiterm.exp spawn override". Thanks, - Tom