[patch] gdb/testsuite: Fix more bugs in gdb testglue wrapper handling

Sandra Loosemore sandra@codesourcery.com
Tue Jul 21 21:41:44 GMT 2020


On 7/21/20 12:13 PM, Tom Tromey wrote:
>>>>>> "Sandra" == Sandra Loosemore <sandra@codesourcery.com> writes:
> 
> Sandra>      if {[target_info exists needs_status_wrapper] && \
> Sandra>  	    [target_info needs_status_wrapper] != "0"} {
> Sandra> -	set result [build_wrapper [standard_output_file "testglue.o"]]
> Sandra> +	set result [build_wrapper "testglue.o"]
> Sandra>  	if { $result != "" } {
> Sandra>  	    set gdb_wrapper_file [lindex $result 0]
> Sandra> +	    if ![is_remote host] {
> Sandra> +		set gdb_wrapper_file [file join [pwd] $gdb_wrapper_file]
> 
> If "make -j check" is used, isn't it possible that multiple runs will
> use the same file name and then clash?

Well, the first part of this patch hunk is undoing an incorrect change 
from commit 24ac169ac5a918cd82b7485935f0c40a094c625e -- incorrect 
because standard_output_file returns a pathname relative to build, which 
cannot generally work on remote host.  Things were apparently working 
fine for years up until February.  :-S

The second part is just the usual idiom to convert a relative pathname 
to absolute in TCL, so that we can refer to it correctly when [pwd] is 
something else.  That was actually the problem the previous commit was 
trying to fix (incorrectly, by trying to rebuild the wrapper in [pwd], 
and leaving the .o files polluting the source directory in some cases).

-Sandra


More information about the Gdb-patches mailing list