Re: [PATCH 1/3][gdb/testsuite] Fix global array cp_class_table_history leak

Tom Tromey
2020-05-22T20:12:10Z

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

Tom> +# This test-case uses the cp_test_ptype_class cache (by means of the ibid
Tom> +# argument), so initialize and finalize the cache.
Tom> +init_cp_test_ptype_class_cache
Tom> +
Tom> do_tests
Tom> +
Tom> +finish_cp_test_ptype_class_cache

If the users always have to do this init/test/finish thing, then maybe
some kind of wrapper proc would be more appropriate.

Also, it's more robust to use 'catch' to ensure that the cleanup is
always run.

However, is the finish bit needed? If the init proc cleans up all the
state, then it seems unnecessary.

Tom