aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-03-09 15:32:54 +0100
committerTom de Vries <tdevries@suse.de>2020-03-09 15:32:54 +0100
commit0ba678c9ae62c20bb7f2370f51a4e9f1c8f2f409 (patch)
treeac2a462f62ed6a3f90f2b74d9745097bec0a0882 /gdb
parent95099889938ef50922779a0db03f277eea8747b5 (diff)
downloadgdb-0ba678c9ae62c20bb7f2370f51a4e9f1c8f2f409.zip
gdb-0ba678c9ae62c20bb7f2370f51a4e9f1c8f2f409.tar.gz
gdb-0ba678c9ae62c20bb7f2370f51a4e9f1c8f2f409.tar.bz2
[gdb/testsuite] Fix tcl error in cached_file
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/lib/gdb.exp3
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c3dda74..f9e0c20 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 55e5858..9614e8d 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4958,6 +4958,9 @@ proc cached_file { filename txt {executable 0}} {
return $filename
}
+ set dir [file dirname $filename]
+ file mkdir $dir
+
set tmp_filename $filename.[pid]
set fd [open $tmp_filename w]
puts $fd $txt