diff options
author | Chris Johns <chrisj@rtems.org> | 2007-12-14 04:52:24 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2007-12-14 04:52:24 +0000 |
commit | 2199d748f5c4dc8887c15d6fd307ffc15c0c97f5 (patch) | |
tree | 309a77ffe0d5653945c2187ffbcac8fc595dd134 | |
parent | 2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-2199d748f5c4dc8887c15d6fd307ffc15c0c97f5.tar.bz2 |
2007-12-14 Chris Johns <chrisj@rtems.org>
* gdb-init: Add the show-exception.
-rw-r--r-- | c/src/lib/libbsp/m68k/mcf5235/ChangeLog | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mcf5235/gdb-init | 27 |
2 files changed, 30 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf5235/ChangeLog b/c/src/lib/libbsp/m68k/mcf5235/ChangeLog index 7979eec93d..7e7786baeb 100644 --- a/c/src/lib/libbsp/m68k/mcf5235/ChangeLog +++ b/c/src/lib/libbsp/m68k/mcf5235/ChangeLog @@ -1,3 +1,7 @@ +2007-12-14 Chris Johns <chrisj@rtems.org> + + * gdb-init: Add the show-exception. + 2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com> * include/bsp.h, startup/bspstart.c: Eliminate copies of the diff --git a/c/src/lib/libbsp/m68k/mcf5235/gdb-init b/c/src/lib/libbsp/m68k/mcf5235/gdb-init index bda3cccaaa..23fa2abe67 100644 --- a/c/src/lib/libbsp/m68k/mcf5235/gdb-init +++ b/c/src/lib/libbsp/m68k/mcf5235/gdb-init @@ -4,12 +4,37 @@ target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0 # -# The console loop the Axman dbug monitor. Found by trial and error +# The console loop in the Axman dbug monitor. Found by trial and error # with the debugger. # hb *0xffe254c0 # +# Show the exception stack frame. +# +define show-exception-sframe + set $frsr = *(unsigned short *)((unsigned long)$sp + 2) + set $frpc = *(unsigned long *)((unsigned long)$sp + 4) + set $frfvo = *(unsigned short *)((unsigned long)$sp + 0) + set $frcode = $frfvo >> 12 + set $frvect = ($frfvo & 0xFFF) >> 2 + set $frstatus = ((($frfvo >> 10) & 3) << 2) | ($frfvo & 3) + printf "EXCEPTION -- SR:0x%X PC:0x%X FRAME:0x%x VECTOR:%d STATUS:%d\n", $frsr, $frpc, $frcode, $frvect, $frstatus + if $frstatus == 4 + printf " Fault Type: Error on instruction fetch" + end + if $frstatus == 8 + printf " Fault Type: Error on operand write" + end + if $frstatus == 12 + printf " Fault Type: Error on operand read" + end + if $frstatus == 9 + printf " Fault Type: Attempted write to write-protected space" + end +end + +# # Run to initialise the RAM. The target will stop when the # breakpoint is hit. Load the program. # |