[llvm-commits] CVS: llvm/test/Programs/RunSafely.sh
John Criswell
criswell at cs.uiuc.edu
Thu Jul 3 12:52:00 PDT 2003
Changes in directory llvm/test/Programs:
RunSafely.sh updated: 1.8 -> 1.9
---
Log message:
Fixed the time command code (once again) so that it conforms to proper
Borne syntax.
Added code that generates stack traces using gdb-64 when on Sparc.
---
Diffs of the changes:
Index: llvm/test/Programs/RunSafely.sh
diff -u llvm/test/Programs/RunSafely.sh:1.8 llvm/test/Programs/RunSafely.sh:1.9
--- llvm/test/Programs/RunSafely.sh:1.8 Wed Jul 2 15:42:05 2003
+++ llvm/test/Programs/RunSafely.sh Thu Jul 3 12:50:57 2003
@@ -27,6 +27,18 @@
ulimit -c unlimited
#
+# If we are on a sun4u machine (UltraSparc), then the code we're generating
+# is 64 bit code. In that case, use gdb-64 instead of gdb.
+#
+myarch=`uname -m`
+if [ "$myarch" = "sun4u" ]
+then
+ GDB="gdb-64"
+else
+ GDB=gdb
+fi
+
+#
# Run the command, timing its execution.
# The standard output and standard error of $PROGRAM should go in $OUTFILE,
# and the standard error of time should go in $OUTFILE.time.
@@ -36,7 +48,7 @@
# we tell time to launch a shell which in turn executes $PROGRAM with the
# necessary I/O redirection.
#
-(time sh -c "$PROGRAM $* >& $OUTFILE < $INFILE") >& $OUTFILE.time
+(time sh -c "$PROGRAM $* > $OUTFILE 2>&1 < $INFILE") > $OUTFILE.time 2>&1
if test $? -eq 0
then
@@ -47,7 +59,7 @@
then
corefile=`ls core* | head -1`
echo "where" > StackTrace.$$
- gdb -q -batch --command=StackTrace.$$ --core=$corefile $PROGRAM < /dev/null
+ $GDB -q -batch --command=StackTrace.$$ --core=$corefile $PROGRAM < /dev/null
rm -f StackTrace.$$ $corefile
fi
More information about the llvm-commits
mailing list