aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristian Groessler <chris@groessler.org>2013-05-21 07:25:51 +0000
committerChristian Groessler <chris@groessler.org>2013-05-21 07:25:51 +0000
commit023928657e0f3dbb017ffc120a80314892a2f9cb (patch)
treedf46506b3c0545966f17aa09ba40796ab410678a /gdb
parentc22554775b23abbf5927a44611ae344784f08514 (diff)
downloadgdb-023928657e0f3dbb017ffc120a80314892a2f9cb.zip
gdb-023928657e0f3dbb017ffc120a80314892a2f9cb.tar.gz
gdb-023928657e0f3dbb017ffc120a80314892a2f9cb.tar.bz2
* gdb.dwarf2/dw2-dir-file-name.exp: Don't use brace expansion,
since it's not supported in all shells.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp33
2 files changed, 34 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e436c6b..b2e7808 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-21 Christian Groessler <chris@groessler.org>
+
+ * gdb.dwarf2/dw2-dir-file-name.exp: Don't use brace expansion,
+ since it's not supported in all shells.
+
2013-05-21 Hui Zhu <hui@codesourcery.com>
* gdb.mi/Makefile.in (PROGS): Add "mi-dprintf".
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
index 2602aef..575f10f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
@@ -322,10 +322,35 @@ if { [gdb_compile "${asmsrcfile} ${srcdir}/${subdir}/$srcfile" "${binfile}" exec
return -1
}
-remote_exec host "sh -c \"rm -f ${srcabsdir}{/rdir,}{/xdir,}{/compdir,}{/ldir,}{/fdir,}/${srctmpfile}\""
-remote_exec host "sh -c \"rmdir ${srcabsdir}{/rdir,}{/xdir,}{/compdir,}{/ldir,}{/fdir,}\""
-remote_exec host "sh -c \"mkdir ${srcabsdir}{,/rdir}{,/xdir}{,/compdir}{,/ldir}{,/fdir}\""
-remote_exec host "sh -c \"for d in ${srcabsdir}{,/rdir}{,/xdir}{,/compdir}{,/ldir}{,/fdir};do cp ${srcdir}/${subdir}/${srcfile} \\\$d/${srctmpfile}; done\""
+set dirs {}
+foreach r {"" /rdir} {
+ foreach x {"" /xdir} {
+ foreach comp {"" /compdir} {
+ foreach l {"" /ldir} {
+ foreach f {"" /fdir} {
+ lappend dirs $r$x$comp$l$f
+ }
+ }
+ }
+ }
+}
+
+proc pathexpand {prefix dirlst suffix} {
+ set retlst {}
+ foreach dir $dirlst {
+ lappend retlst "$prefix$dir$suffix"
+ }
+ return $retlst
+}
+
+set filelist [pathexpand $srcabsdir $dirs "/$srctmpfile"]
+set dircreatelist [pathexpand $srcabsdir $dirs ""]
+set dirremovelist [pathexpand $srcabsdir [lreverse $dirs] ""]
+
+remote_exec host "sh -c \"rm -f $filelist\""
+remote_exec host "sh -c \"rmdir $dirremovelist\""
+remote_exec host "sh -c \"mkdir $dircreatelist\""
+remote_exec host "sh -c \"for d in $dircreatelist; do cp ${srcdir}/${subdir}/${srcfile} \\\$d/${srctmpfile}; done\""
clean_restart ${testfile}