]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
binutils/testsuite: don't tail the same input and output file
authorClément Chigot <chigot@adacore.com>
Mon, 31 Mar 2025 08:42:43 +0000 (10:42 +0200)
committerClément Chigot <chigot@adacore.com>
Tue, 1 Apr 2025 08:14:54 +0000 (10:14 +0200)
The output file could be created before the input is gathered by tail,
erasing the later before it's being proceeded.

This happened on rare cases when performing remote tests on
Ubuntu 24.04.

binutils/testsuite/binutils-all/objdump.exp

index bddb0cb618a6a4adc7a3e83e34afd9b592e87d3b..f3142b104425f4d129508f92d6562375aaefc8cc 100644 (file)
@@ -595,8 +595,8 @@ if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.out"]
-    set output [remote_upload host tmpdir/objdump.out]
+    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.tail"]
+    set output [remote_upload host tmpdir/objdump.tail]
 
     if ![file size $output] then {
        # If the output file is empty, then this target does not
@@ -606,7 +606,7 @@ if { ![is_elf_format] } then {
        return
     }
 
-    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw5-op.W] } then {
+    if { [regexp_diff tmpdir/objdump.tail $srcdir/$subdir/dw5-op.W] } then {
        fail "objdump -Wi for DW_OP_*"
     } else {
        pass "objdump -Wi for DW_OP_*"