From 023928657e0f3dbb017ffc120a80314892a2f9cb Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 21 May 2013 07:25:51 +0000 Subject: [PATCH] * gdb.dwarf2/dw2-dir-file-name.exp: Don't use brace expansion, since it's not supported in all shells. --- gdb/testsuite/ChangeLog | 5 +++ .../gdb.dwarf2/dw2-dir-file-name.exp | 33 ++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e436c6b5a37..b2e780837bd 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-21 Christian Groessler + + * 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 * 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 2602aef8e1f..575f10fcb04 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} -- 2.30.2