summaryrefslogtreecommitdiff
path: root/sim-scripts/gdb-sim.in
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-20 01:11:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-20 01:11:22 +0000
commit2e284ff12ec2d7d22c5dab8463314190b4618aa9 (patch)
treef26aebdd2d6b727358c3b74dd184e87af4d94f68 /sim-scripts/gdb-sim.in
parent82cce79423e3b8a66d31f1b70ad8b5ad5dab7add (diff)
2009-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* .cvsignore, Makefile, gdb-sim-run.in, gdb-sim.in: Add psim support. * psim.in: New file.
Diffstat (limited to 'sim-scripts/gdb-sim.in')
-rwxr-xr-xsim-scripts/gdb-sim.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/sim-scripts/gdb-sim.in b/sim-scripts/gdb-sim.in
index 165cf15..51fda29 100755
--- a/sim-scripts/gdb-sim.in
+++ b/sim-scripts/gdb-sim.in
@@ -37,6 +37,13 @@ bspGeneratesGDBCommands="no"
###################################################################
###################################################################
+## Some BSPs must generate device trees to provide to the simulator
+if [ ${bspGeneratesDeviceTree} = "yes" ] ; then
+ TREE_FILE=@BSP@_tree.${LOGNAME}
+ bspGenerateDeviceTree ${baseToRun} >${TREE_FILE}
+fi
+
+### generate bsp specific load command
if [ ${bspGeneratesGDBCommands} = "no" ] ; then
cat <<EOF
tar sim
@@ -46,6 +53,23 @@ else
bspGenerateGDBCommands
fi >@BSP@-cmds
+### Add CPU specific commands
+case @CPU@ in
+ powerpc) echo "b C_exception_handler" ;;
+ *) ;;
+esac >>@BSP@-cmds
+
+### Add generic commands which break on known bad places
+cat >>@BSP@-cmds <<EOF
+b _Internal_error_Occurred
+b rtems_fatal_error_occurred
+b __assert
+printf "Use run to start the RTEMS application\\n"
+EOF
+
${GDB} --command=@BSP@-cmds $*
+if [ ${bspGeneratesDeviceTree} = "yes" ] ; then
+ rm -f @BSP@_tree.${LOGNAME}
+fi
test_exit $?