source: rtems/c/src/lib/libbsp/powerpc/psim/tools/psim-gdb-bottom @ 5a6d25fc

4.104.11
Last change on this file since 5a6d25fc was 5a6d25fc, checked in by Till Straumann <strauman@…>, on Sep 11, 2009 at 10:42:00 PM

2009-09-11 Till Straumann <Till.Straumann@…>

  • psim-top.in, psim-bottom: Added support for options -d (print device tree and exit), -h (usage info) and -n (enable NIC support).
  • psim-gdb-bottom: Added support for options -s (force sysv IPC), -h (usage info) and -n (enable NIC support). Allow user to override GDB variable from environment.
  • psim-shared: cat NIC properties into device file if the user had specified '-n'.
  • runtest-top.in: removed unsupported options -o, -d from usage info.
  • Property mode set to 100755
File size: 1.2 KB
Line 
1progname=${0##*/} # fast basename hack for ksh, bash
2
3USAGE=\
4"usage: $progname [ -opts ] [prog]
5        -s  -- force System V IPC support on (default=auto)
6        -n  -- enable NIC support ***REQUIRES PATCHED GDB/PSIM***
7        -h  -- this message
8"
9
10# Recognize special argument to force System V IPC support on
11use_sysv_ipc="auto"
12enable_if_sim=""
13
14## TODO: may want command line ability to turn on some psim tracing
15while getopts snh OPT
16do
17        case "$OPT" in
18        s) use_sysv_ipc="yes";;
19        n) enable_if_sim="yes";;
20        h) echo "$USAGE"; exit 0;;
21        *) echo "unknown option"; echo "$USAGE"; exit 0;;
22        esac
23done
24shiftcount=`expr $OPTIND - 1`
25shift $shiftcount
26
27args=$*
28
29if [ X${1} = "X-psim_sysv" ] ; then
30  use_sysv_ipc="yes"
31  shift
32fi
33
34## Generate the GDB Command Script
35gen_gdb_script()
36{
37  echo "tar sim -f ${TREE_FILE}"
38  echo "load"
39  echo "b _Internal_error_Occurred"
40  echo "b rtems_fatal_error_occurred"
41  echo "b __assert_func"
42  echo "b C_exception_handler"
43  echo "printf \"Use run to start the RTEMS application\\n\""
44}
45
46if [ X${GDB} = X ] ; then
47        GDB=${rtemsTarget}-gdb
48fi
49
50gen_device_tree ${1} >${TREE_FILE}
51gen_gdb_script       >${GDB_FILE}
52
53${GDB} -x ${GDB_FILE} $*
54
55rm -f ${GDB_FILE} ${TREEFILE}
56exit $?
57
Note: See TracBrowser for help on using the repository browser.