When trying to run tests using target board cc-with-dwz after a clean build, I
run into:
...
ERROR: tcl error sourcing board description file for target cc-with-tweaks.exp.
couldn't open "build/gdb/testsuite/cache/gdb.sh.17028": \
no such file or directory
couldn't open "build/gdb/testsuite/cache/gdb.sh.17028": \
no such file or directory
while executing
"open $tmp_filename w"
(procedure "cached_file" line 9)
invoked from within
"cached_file gdb.sh "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS \"\$@\"" 1"
...
The problem is that cached_file is trying to create a file
build/gdb/testsuite/cache/gdb.sh.17028 in a non-existing directory.
Fix this by creating the cache dir in cached_file.
Tested on x86_64-linux, with target board cc-with-tweaks, and native.
gdb/testsuite/ChangeLog:
2020-03-09 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (cached_file): Create cache dir.
+2020-03-09 Tom de Vries <tdevries@suse.de>
+
+ * lib/gdb.exp (cached_file): Create cache dir.
+
2020-03-07 Tom de Vries <tdevries@suse.de>
* gdb.cp/ref-params.exp: Compare build_executable result with -1.
return $filename
}
+ set dir [file dirname $filename]
+ file mkdir $dir
+
set tmp_filename $filename.[pid]
set fd [open $tmp_filename w]
puts $fd $txt