Back to home page

LXR

 
 

    


Warning, /bsps/m68k/mcf5235/gdb-init is written in an unsupported language. File is not indexed.

0001 #
0002 # Connect to the target.
0003 # 
0004 target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
0005 
0006 #
0007 # The console loop in the Axman dbug monitor. Found by trial and error
0008 # with the debugger.
0009 #
0010 thb *0xffe254c0
0011 
0012 #
0013 # Show the exception stack frame.
0014 #
0015 define show-exception-sframe
0016  set $frsr = *(unsigned short *)((unsigned long)$sp + 2)
0017  set $frpc = *(unsigned long *)((unsigned long)$sp + 4)
0018  set $frfvo = *(unsigned short *)((unsigned long)$sp + 0)
0019  set $frcode = $frfvo >> 12
0020  set $frvect = ($frfvo & 0xFFF) >> 2
0021  set $frstatus = ((($frfvo >> 10) & 3) << 2) | ($frfvo & 3)
0022  printf "EXCEPTION -- SR:0x%X  PC:0x%X  FRAME:0x%x  VECTOR:%d  STATUS:%d\n", $frsr, $frpc, $frcode, $frvect, $frstatus
0023  if $frstatus == 4
0024   printf " Fault Type: Error on instruction fetch"
0025  end
0026  if $frstatus == 8
0027   printf " Fault Type: Error on operand write"
0028  end
0029  if $frstatus == 12
0030   printf " Fault Type: Error on operand read"
0031  end
0032  if $frstatus == 9
0033   printf " Fault Type: Attempted write to write-protected space"
0034  end
0035 end
0036 
0037 #
0038 # Run to initialise the RAM. The target will stop when the
0039 # breakpoint is hit. Load the program.
0040 #
0041 c
0042 load
0043 
0044 #
0045 # Break on an exception.
0046 #
0047 b _uhoh
0048 
0049 #
0050 # Travel to main then stop.
0051 #
0052 tb main
0053 c
0054