[PATCH 3/3] [gdb/testsuite] Use save_vars to restore GDBFLAGS

Tom Tromey tom@tromey.com
Fri May 3 20:10:05 GMT 2024


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> There's a pattern of using:
Tom> ...
Tom> set saved_gdbflags $GDBFLAGS
Tom> set GDBFLAGS "$GDBFLAGS ..."
Tom> <do something with GDBFLAGS>
Tom> set GDBFLAGS $saved_gdbflags
Tom> ...

Tom> Simplify this by using save_vars:
Tom> ...
Tom> save_vars { GDBFLAGS } {
Tom>     set GDBFLAGS "$GDBFLAGS ..."
Tom>     <do something with GDBFLAGS>
Tom> }
Tom> ...

Great minds...
https://inbox.sourceware.org/gdb-patches/20240206173132.1272893-1-tom@tromey.com/

Anyway, ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom


More information about the Gdb-patches mailing list