]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix stray file in get_compiler_info
authorTom de Vries <tdevries@suse.de>
Wed, 1 May 2024 09:46:05 +0000 (11:46 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 1 May 2024 09:46:05 +0000 (11:46 +0200)
When running test-case gdb.dwarf2/gdb-index-nodebug.exp with host board
local-remote-host and target board remote-gdbserver-on-localhost, I get:
...
$ ls build/gdb/testsuite
cache    compiler.i  config.log  config.status  gdb.log  gdb.sum  lib  Makefile
outputs  site.bak    site.exp    temp
...

The file compiler.i is there because get_compiler_info uses:
...
set ppout "$outdir/compiler.i"
...

The file is a temporary, and as such belongs in a temp dir.  Fix this by using
standard_temp_file, moving the file to build/gdb/testsuite/temp/<pid>/compiler.i.

Tested on x86_64-linux.

gdb/testsuite/lib/gdb.exp

index d092258a9e5026173c57bde688f58a6446a65b79..fe3f05c18df943c66f848d45c42d0d798d655232 100644 (file)
@@ -4882,7 +4882,7 @@ proc get_compiler_info {{language "c"}} {
     if [is_remote host] {
        # We have to use -E and -o together, despite the comments
        # above, because of how DejaGnu handles remote host testing.
-       set ppout "$outdir/compiler.i"
+       set ppout [standard_temp_file compiler.i]
        gdb_compile "${ifile}" "$ppout" preprocess [list "$language" quiet getting_compiler_info]
        set file [open $ppout r]
        set cppout [read $file]