#!/bin/sh
# Run OCS program under gdb
# $Header: /home/uebb/uebb/CVS/ocs/src/om/scripts/debug,v 1.1.1.1 1998/06/16 15:59:51 wg Exp $

gdb=gdb
rm=/bin/rm

if [ $# -lt 1 ]
then
  echo "usage: `basename $0` program argument ..."
  exit 2
fi

program=$1
shift

for arg
do
  arguments="$arguments \"$arg\""
done
gdbcmdfile=/tmp/debug_$$

# commands to be executed by gdb
echo run $arguments >$gdbcmdfile

# run gdb 
$gdb -fullname -se $program -x $gdbcmdfile -nx 
$rm -f $gdbcmdfile
