#!/bin/sh

# the directory where this script lives
snbindir=`dirname $0`
script=snpdbg

# $script is either in ../share/etc/ or ../../share/etc/

if test -f $snbindir/../share/etc/$script; then
    etcdir=`cd $snbindir/../share/etc; pwd`
elif test -f $snbindir/../../share/etc/$script; then
    etcdir=`cd $snbindir/../../share/etc; pwd`
else
    echo "Cannot find Source-Navigator's startup script."
fi

# Run SN inside GDB
#echo "set args -file "$etcdir/$script" ${1+"$@"}" > gdb.run
#exec gdb --command gdb.run $snbindir/hyper

# Run SN
exec "$snbindir/hyper" -file "$etcdir/$script" ${1+"$@"}
