Back to home page

LXR

 
 

    


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

0001 #
0002 # Show the exception stack frame.
0003 #
0004 define show-exception-sframe
0005  set $frsr = *(unsigned short *)((unsigned long)$sp + 2)
0006  set $frpc = *(unsigned long *)((unsigned long)$sp + 4)
0007  set $frfvo = *(unsigned short *)((unsigned long)$sp + 0)
0008  set $frcode = $frfvo >> 12
0009  set $frvect = ($frfvo & 0xFFF) >> 2
0010  set $frstatus = ((($frfvo >> 10) & 3) << 2) | ($frfvo & 3)
0011  printf "EXCEPTION -- SR:0x%X  PC:0x%X  FRAME:0x%x  VECTOR:%d  STATUS:%d\n", $frsr, $frpc, $frcode, $frvect, $frstatus
0012  if $frstatus == 4
0013   printf " Fault Type: Error on instruction fetch"
0014  end
0015  if $frstatus == 8
0016   printf " Fault Type: Error on operand write"
0017  end
0018  if $frstatus == 12
0019   printf " Fault Type: Error on operand read"
0020  end
0021  if $frstatus == 9
0022   printf " Fault Type: Attempted write to write-protected space"
0023  end
0024 end
0025 
0026 # Add -v and -d flags for bdm info
0027 # Add -B flags to utilize hardware breakpoints when they are availiable
0028 
0029 #target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
0030 target remote | m68k-bdm-gdbserver pipe /dev/tblcf2 -B
0031 #monitor set remote-debug 1
0032 
0033 monitor bdm-reset
0034 
0035 # Set VBR to the beginning of what will be SRAM
0036 monitor bdm-ctl-set 0x0801 0x20000000
0037 
0038 # Set RAMBAR1
0039 monitor bdm-ctl-set 0x0C05 0x20000021
0040 
0041 # Set FLASHBAR
0042 monitor bdm-ctl-set 0x0C04 0x00000061
0043 
0044 # Enable PST[3:0] signals
0045 set *((char*) 0x40100074) = 0x0F
0046 
0047 # Add the load when debugging from ram which won't happen with rtems!
0048 #load