1 | # |
---|
2 | # Show the exception stack frame. |
---|
3 | # |
---|
4 | define show-exception-sframe |
---|
5 | set $frsr = *(unsigned short *)((unsigned long)$sp + 2) |
---|
6 | set $frpc = *(unsigned long *)((unsigned long)$sp + 4) |
---|
7 | set $frfvo = *(unsigned short *)((unsigned long)$sp + 0) |
---|
8 | set $frcode = $frfvo >> 12 |
---|
9 | set $frvect = ($frfvo & 0xFFF) >> 2 |
---|
10 | set $frstatus = ((($frfvo >> 10) & 3) << 2) | ($frfvo & 3) |
---|
11 | printf "EXCEPTION -- SR:0x%X PC:0x%X FRAME:0x%x VECTOR:%d STATUS:%d\n", $frsr, $frpc, $frcode, $frvect, $frstatus |
---|
12 | if $frstatus == 4 |
---|
13 | printf " Fault Type: Error on instruction fetch" |
---|
14 | end |
---|
15 | if $frstatus == 8 |
---|
16 | printf " Fault Type: Error on operand write" |
---|
17 | end |
---|
18 | if $frstatus == 12 |
---|
19 | printf " Fault Type: Error on operand read" |
---|
20 | end |
---|
21 | if $frstatus == 9 |
---|
22 | printf " Fault Type: Attempted write to write-protected space" |
---|
23 | end |
---|
24 | end |
---|
25 | |
---|
26 | # Add -v and -d flags for bdm info |
---|
27 | # Add -B flags to utilize hardware breakpoints when they are availiable |
---|
28 | |
---|
29 | #target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0 |
---|
30 | target remote | m68k-bdm-gdbserver pipe /dev/tblcf2 -B |
---|
31 | #monitor set remote-debug 1 |
---|
32 | |
---|
33 | monitor bdm-reset |
---|
34 | |
---|
35 | # Set VBR to the beginning of what will be SRAM |
---|
36 | monitor bdm-ctl-set 0x0801 0x20000000 |
---|
37 | |
---|
38 | # Set RAMBAR1 |
---|
39 | monitor bdm-ctl-set 0x0C05 0x20000021 |
---|
40 | |
---|
41 | # Set FLASHBAR |
---|
42 | monitor bdm-ctl-set 0x0C04 0x00000061 |
---|
43 | |
---|
44 | # Enable PST[3:0] signals |
---|
45 | set *((char*) 0x40100074) = 0x0F |
---|
46 | |
---|
47 | # Add the load when debugging from ram which won't happen with rtems! |
---|
48 | #load |
---|