| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 |
| 4 |
# Free Software Foundation, Inc. |
| 5 |
# This file is part of GNU Modula-2. |
| 6 |
# |
| 7 |
# GNU Modula-2 is free software; you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 2, or (at your option) |
| 10 |
# any later version. |
| 11 |
# |
| 12 |
# GNU Modula-2 is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with GNU Modula-2; see the file COPYING. If not, write to the |
| 19 |
# Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA |
| 20 |
# 02110-1301, USA. |
| 21 |
# |
| 22 |
|
| 23 |
GCC_VERSION=3.3.1 |
| 24 |
BFLAGS=-B../../../../../../../build-$GCC_VERSION/gcc/stage1/gm2 |
| 25 |
LIBS=-I.:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/$GCC_VERSION/gm2 |
| 26 |
DRIVER=../../../../../../../build-$GCC_VERSION/gcc/xgm2 |
| 27 |
OPTS=$2 |
| 28 |
CPP= |
| 29 |
|
| 30 |
if [ ! -x $DRIVER ] ; then |
| 31 |
echo "cannot find $DRIVER" |
| 32 |
exit 1 |
| 33 |
fi |
| 34 |
if ! $DRIVER $OPTS $BFLAGS $LIBS -gstabs -c $1 ; then |
| 35 |
exit $? |
| 36 |
fi |
| 37 |
if ! $DRIVER $OPTS $BFLAGS $LIBS -S -gstabs -c $1 ; then |
| 38 |
exit $? |
| 39 |
fi |
| 40 |
if ! $DRIVER $OPTS $BFLAGS $LIBS -gstabs -I. $1 -lm ; then |
| 41 |
exit $? |
| 42 |
fi |
| 43 |
cat << EOFEOF > .gdbinit |
| 44 |
# set language modula-2 |
| 45 |
# set language pascal |
| 46 |
break _M2_`basename $1 .mod`_init |
| 47 |
run |
| 48 |
#next |
| 49 |
#print r |
| 50 |
#ptype r |
| 51 |
EOFEOF |
| 52 |
emacs .gdbinit |
| 53 |
|