[PATCH] gdb/testsuite: Regenerate the testglue if it is not in path

Tom Tromey tom@tromey.com
Tue Feb 11 15:41:00 GMT 2020


>>>>> "Shahab" == Shahab Vahedi <shahab.vahedi@gmail.com> writes:

Shahab> For running the  DejaGnu  tests,  some  esoteric  configurations
Shahab> may require a testglue.

Thank you for the patch.  I wasn't aware of this code at all :-)

Shahab> This patch checks if the wrapper file ("gdb_tg.o") is  still  in
Shahab> reach and if it is not, it will stimulate the generation of  the
Shahab> wrapper again.

I wonder if it would make sense to instead set gdb_wrapper_file to the
absolute path.

It could perhaps be put in the cache directory.  This might help avoid
recompiling it many times when running the tests in parallel.

What do you think of that?

Shahab> +    # if the wrapper is initialized but the wrapper file cannot be

GNU style is to start a comment with an upper-case letter, so "If".

Shahab> +    # found anymore, the wrapper file must be built again.
Shahab> +    if { $gdb_wrapper_initialized == 1 && \
Shahab> +	    [info exists gdb_wrapper_file] && \
Shahab> +	    ![file exists $gdb_wrapper_file] } {
Shahab> +	verbose "reinitializing the wrapper"
Shahab> +	set gdb_wrapper_initialized 0
Shahab> +    }
Shahab> +
Shahab>      if { $gdb_wrapper_initialized == 0 } { gdb_wrapper_init }

If you don't like the absolute path idea, maybe just having all this
logic be in the wrapper code would be better, and this could just call
gdb_wrapper_init unconditionally.

Tom



More information about the Gdb-patches mailing list