source: rtems-testing/sim-scripts/gdb-sim.in @ ae52ee2

4.11
Last change on this file since ae52ee2 was 96c31138, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 20, 2009 at 8:17:05 PM

2009-01-20 Joel Sherrill <joel.sherrill@…>

  • .cvsignore, Makefile, gdb-sim-run.in, gdb-sim.in, skyeye-support: Add qemu-rtems script.
  • qemu-rtems.in: New file.
  • Property mode set to 100755
File size: 2.3 KB
Line 
1#! /bin/sh
2#
3#  Framework script tailored for the @CPU@/@BSP@
4#
5#  NOTE: If the does not have the name of a specific CPU/BSP pair, then
6#        this is the source file.  If it does have specific CPU/BSP pair,
7#        then this is generated output and should NOT be edited.
8#
9#  $Id$
10#
11
12trap "test_exit 1" 1 2 3 13 14 15
13
14progname=${0##*/}        # fast basename hack for ksh, bash
15
16for v in 4.10 4.9 4.8 4.7 ""
17do
18  type @CPU_TARGET@-rtems${v}-gdb >/dev/null 2>&1
19  if [ $? -eq 0 ] ; then
20    GDB=@CPU_TARGET@-rtems${v}-gdb
21    break
22  fi
23  if [ X${GDB} = X ] ; then
24    echo "Unable to find a GDB for @CPU_TARGET@ along your PATH"
25    exit 1
26  fi
27
28  test ${verbose} = "yes" && echo Using ${GDB}
29done
30
31if [ X${GDB} = X ] ; then
32  echo "Unable to find a GDB for @CPU_TARGET@ along your PATH"
33  exit 1
34fi
35
36test_exit()
37{
38  exit_code=$1
39  rm -f @BSP@-cmds
40  exit $exit_code
41}
42
43if [ $# -eq 0 ] ; then
44  echo "No arguments .. no executable specified"
45  exit 1
46fi
47
48### Set BSP defaults.  If BSP does not have default, it will override
49bspGeneratesGDBCommands="no"
50bspGeneratesDeviceTree="no"
51
52###################################################################
53###################################################################
54###################################################################
55##INSERT BSP SUPPORT HERE
56###################################################################
57###################################################################
58###################################################################
59
60## Some BSPs must generate device trees to provide to the simulator
61if [ ${bspGeneratesDeviceTree} = "yes" ] ; then
62  TREE_FILE=@BSP@_tree.${LOGNAME}
63  bspGenerateDeviceTree ${baseToRun} >${TREE_FILE}
64fi
65
66### generate bsp specific load command
67if [ ${bspGeneratesGDBCommands} = "no" ] ; then
68  cat <<EOF
69tar sim
70load
71EOF
72else
73  bspGenerateGDBCommands
74fi >@BSP@-cmds
75
76###  Add CPU specific commands
77case @CPU@ in
78  powerpc) echo  "b C_exception_handler" ;;
79  *)       ;;
80esac >>@BSP@-cmds
81
82###  Add generic commands which break on known bad places
83cat >>@BSP@-cmds <<EOF
84b _Internal_error_Occurred
85b rtems_fatal_error_occurred
86b __assert
87printf "Use run to start the RTEMS application\\n"
88EOF
89
90${GDB} --command=@BSP@-cmds $*
91
92if [ ${bspGeneratesDeviceTree} = "yes" ] ; then
93  rm -f @BSP@_tree.${LOGNAME}
94fi
95test_exit $?
Note: See TracBrowser for help on using the repository browser.