Hi!

I've got a question regarding the 'gcc/testsuite/lib/asan-dg.exp'
overriding of '${tool}_load', which was introduced here,
Subversion r193511 (Git commit 8335a6439ddb66aa9ebc67ee47aa2e6e317e3ef9):

On 2012-11-14T12:11:13+0100, Jakub Jelinek <ja...@redhat.com> wrote:
> --- gcc/testsuite/lib/asan-dg.exp.jj  2012-11-14 09:11:13.086054131 +0100
> +++ gcc/testsuite/lib/asan-dg.exp     2012-11-14 11:45:40.142061595 +0100

> +# Replace ${tool}_load with a wrapper so that we can symbolize the output.
> +if { [info procs ${tool}_load] != [list] \
> +      && [info procs saved_asan_${tool}_load] == [list] } {
> +    rename ${tool}_load saved_asan_${tool}_load
> +
> +    proc ${tool}_load { program args } {
> +     global tool
> +     set result [eval [list saved_asan_${tool}_load $program] $args]
> +     set output [lindex $result 1]
> +     set symbolized_output [asan_symbolize "$output"]
> +     set result [list [lindex $result 0] $symbolized_output]
> +     return $result
> +    }
> +}

So, once 'load_lib asan-dg.exp' has been done, this globally wraps
'${tool}_load', forever, for all following '*.exp' test suites, too.
This introduces overhead: routes every '${tool}_load' through
'asan_symbolize', even for non-ASAN '*.exp' test suites.

Following the usual pattern, shouldn't we do such wrapping only locally,
where necessary?  Here, I suppose we could move this wrapping setup into
'asan_init', and then undo it in 'asan_finish'.

I'll be happy to draft a patch if someone confirms my thinking.


Grüße
 Thomas

Reply via email to