diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-19 23:53:45 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-19 23:53:45 +0000 |
commit | 82cce79423e3b8a66d31f1b70ad8b5ad5dab7add (patch) | |
tree | ba9ee7b70c4f7c2ba7afa074e0be43f0cdc819b4 /sim-scripts | |
parent | 2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-testing-82cce79423e3b8a66d31f1b70ad8b5ad5dab7add.tar.bz2 |
2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* .cvsignore, Makefile, jmr3904.in, mkrun: Now generate gdb script for
h8sim, jmr3904 m32csim, m32rsim, simsh and sis.
* gdb-sim.in: New file.
Diffstat (limited to 'sim-scripts')
-rw-r--r-- | sim-scripts/.cvsignore | 6 | ||||
-rw-r--r-- | sim-scripts/ChangeLog | 6 | ||||
-rw-r--r-- | sim-scripts/Makefile | 16 | ||||
-rwxr-xr-x | sim-scripts/gdb-sim.in | 51 | ||||
-rw-r--r-- | sim-scripts/jmr3904.in | 10 | ||||
-rwxr-xr-x | sim-scripts/mkrun | 11 |
6 files changed, 92 insertions, 8 deletions
diff --git a/sim-scripts/.cvsignore b/sim-scripts/.cvsignore index ce8be08..678aa97 100644 --- a/sim-scripts/.cvsignore +++ b/sim-scripts/.cvsignore @@ -1,7 +1,13 @@ h8sim +h8sim-gdb jmr3904 +jmr3904-gdb m32csim +m32csim-gdb m32rsim +m32rsim-gdb simsh +simsh-gdb sis +sis-gdb usleep diff --git a/sim-scripts/ChangeLog b/sim-scripts/ChangeLog index 05cd92d..7ecb2a3 100644 --- a/sim-scripts/ChangeLog +++ b/sim-scripts/ChangeLog @@ -1,5 +1,11 @@ 2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> + * .cvsignore, Makefile, jmr3904.in, mkrun: Now generate gdb script for + h8sim, jmr3904 m32csim, m32rsim, simsh and sis. + * gdb-sim.in: New file. + +2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com> + * .cvsignore, Makefile: Switch to using script to do sed and add versioning on installation. * mkrun: New file. diff --git a/sim-scripts/Makefile b/sim-scripts/Makefile index c4ee1af..1690ce9 100644 --- a/sim-scripts/Makefile +++ b/sim-scripts/Makefile @@ -3,7 +3,8 @@ # INSTALL_DIR=../bin -GENERATED_SCRIPTS=h8sim jmr3904 m32csim m32rsim sis simsh +GENERATED_SCRIPTS=h8sim h8sim-gdb jmr3904 jmr3904-gdb m32csim m32csim-gdb \ + m32rsim m32rsim-gdb sis sis-gdb simsh simsh-gdb COMPILED_PROGRAMS=usleep all: prep ${GENERATED_SCRIPTS} ${COMPILED_PROGRAMS} install @@ -14,22 +15,22 @@ prep: usleep: usleep.c $(CC) -o $@ $< -h8sim: gdb-sim-run.in h8sim.in +h8sim h8sim-gdb: gdb-sim-run.in gdb-sim.in h8sim.in ./mkrun H8300 h8300 h8sim -jmr3904: gdb-sim-run.in jmr3904.in +jmr3904 jmr3904-gdb: gdb-sim-run.in gdb-sim.in jmr3904.in ./mkrun MIPS mipstx39 jmr3904 -m32csim: gdb-sim-run.in m32csim.in +m32csim m32csim-gdb: gdb-sim-run.in gdb-sim.in m32csim.in ./mkrun M32C m32c m32csim -m32rsim: gdb-sim-run.in m32rsim.in +m32rsim m32rsim-gdb: gdb-sim-run.in gdb-sim.in m32rsim.in ./mkrun M32R m32r m32rsim -sis: gdb-sim-run.in sis.in +sis sis-gdb: gdb-sim-run.in gdb-sim.in sis.in ./mkrun SPARC sparc sis -simsh: gdb-sim-run.in simsh.in +simsh simsh-gdb: gdb-sim-run.in gdb-sim.in simsh.in ./mkrun SuperH sh simsh clean: @@ -41,6 +42,7 @@ install: done for i in ${GENERATED_SCRIPTS} ; do \ cp $${i} ${INSTALL_DIR}/$${i}-4.10 ; \ + chmod +x ${INSTALL_DIR}/$${i}-4.10 ; \ done cd ${INSTALL_DIR} ; for i in ${GENERATED_SCRIPTS} ; do \ for v in 4.9 4.8 4.7 4.6 ; do \ diff --git a/sim-scripts/gdb-sim.in b/sim-scripts/gdb-sim.in new file mode 100755 index 0000000..165cf15 --- /dev/null +++ b/sim-scripts/gdb-sim.in @@ -0,0 +1,51 @@ +#! /bin/sh +# +# Framework script tailored for the @CPU@/@BSP@ +# +# NOTE: If the does not have the name of a specific CPU/BSP pair, then +# this is the source file. If it does have specific CPU/BSP pair, +# then this is generated output and should NOT be edited. +# +# $Id$ +# + +trap "test_exit 1" 1 2 3 13 14 15 + +progname=${0##*/} # fast basename hack for ksh, bash +rtemsVersion=`echo ${progname} | sed -e 's/@BSP@-//' -e 's/gdb-//'` +GDB=@CPU_TARGET@-rtems${rtemsVersion}-gdb + +test_exit() +{ + exit_code=$1 + rm -f @BSP@-cmds + exit $exit_code +} + +if [ $# -eq 0 ] ; then + echo "No arguments .. no executable specified" + exit 1 +fi + +bspGeneratesGDBCommands="no" + +################################################################### +################################################################### +################################################################### +##INSERT BSP SUPPORT HERE +################################################################### +################################################################### +################################################################### + +if [ ${bspGeneratesGDBCommands} = "no" ] ; then + cat <<EOF +tar sim +load +EOF +else + bspGenerateGDBCommands +fi >@BSP@-cmds + +${GDB} --command=@BSP@-cmds $* + +test_exit $? diff --git a/sim-scripts/jmr3904.in b/sim-scripts/jmr3904.in index ad02647..3bce2c1 100644 --- a/sim-scripts/jmr3904.in +++ b/sim-scripts/jmr3904.in @@ -33,3 +33,13 @@ bspLimit() esac return ${limit} } + +bspGeneratesGDBCommands="yes" + +bspGenerateGDBCommands() +{ +cat <<EOF +tar sim --board=jmr3904 +load +EOF +} diff --git a/sim-scripts/mkrun b/sim-scripts/mkrun index 3fe5942..a56297d 100755 --- a/sim-scripts/mkrun +++ b/sim-scripts/mkrun @@ -10,9 +10,18 @@ BSP=$3 RUN=${BSP} GDB=${BSP}-gdb +# Generate RUN script sed -e "s/@CPU@/${CPU}/" \ -e "s/@CPU_TARGET@/${CPU_TARGET}/" \ -e "s/@BSP@/${BSP}/" \ -e "/^##INSERT BSP SUPPORT HERE/r ${BSP}.in" <gdb-sim-run.in >${RUN} -chmod +x ${RUN} + +# Generate GDB script +sed -e "s/@CPU@/${CPU}/" \ + -e "s/@CPU_TARGET@/${CPU_TARGET}/" \ + -e "s/@BSP@/${BSP}/" \ + -e "/^##INSERT BSP SUPPORT HERE/r ${BSP}.in" <gdb-sim.in >${GDB} + +# Make both executable +chmod +x ${RUN} ${GDB} exit 0 |