Mercurial > hg > Members > kono > nitros9-code
annotate scripts/os9.gdb @ 3272:53827d60f062
scripts/os9_gdb: Show CRC in module directory list
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sat, 07 Mar 2020 20:20:59 +0100 |
parents | 11d87afc644a |
children |
rev | line source |
---|---|
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
1 # gdb scripts for NitrOS-9 (or OS-9) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
2 # Copyright 2014 Tormod Volden |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
3 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
4 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
5 define hook-stop |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
6 printf "S=%04x X=%04x Y=%04x U=%04x A=%02x B=%02x CC=%02x PC=%04x ", $s, $x, $y, $u, $a, $b, $cc , $pc |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
7 os9_mwhere |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
8 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
9 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
10 document hook-stop |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
11 Pretty-print of registers on every halt, |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
12 and updates external source code window. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
13 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
14 |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
15 define os9_mname |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
16 set $mname = (char*)$arg0 + *((int*)$arg0 + 2) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
17 while 1 |
3256
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
18 if (*$mname < 0x20) |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
19 loop_break |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
20 end |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
21 if (*$mname < 0x80) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
22 printf "%c", *$mname |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
23 else |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
24 printf "%c", *$mname-0x80 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
25 loop_break |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
26 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
27 set $mname += 1 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
28 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
29 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
30 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
31 document os9_mname |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
32 Print name of module at given address |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
33 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
34 |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
35 define os9_mident |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
36 set $m = (int*)$arg0 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
37 set $msize = *($m + 1) |
3272
53827d60f062
scripts/os9_gdb: Show CRC in module directory list
Tormod Volden <debian.tormod@gmail.com>
parents:
3256
diff
changeset
|
38 set $mend = (char*) $m + $msize |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
39 set $mtype = *((char*) $m + 6) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
40 set $mexec = *(int*)((char*) $m + 9) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
41 printf "%04x %4x %2X ", $m, $msize, $mtype |
3272
53827d60f062
scripts/os9_gdb: Show CRC in module directory list
Tormod Volden <debian.tormod@gmail.com>
parents:
3256
diff
changeset
|
42 printf "%02X%02X%02X ", *((char*)$mend-3), *((char*)$mend-2), *((char*)$mend-1) |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
43 os9_mname $m |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
44 if ($mtype & 0xf) |
3272
53827d60f062
scripts/os9_gdb: Show CRC in module directory list
Tormod Volden <debian.tormod@gmail.com>
parents:
3256
diff
changeset
|
45 printf "\t\t[exec %04x] ", (char*)$m + $mexec |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
46 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
47 printf "\n" |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
48 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
49 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
50 document os9_mident |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
51 Print details of module at given address. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
52 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
53 |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
54 define os9_mdir |
3272
53827d60f062
scripts/os9_gdb: Show CRC in module directory list
Tormod Volden <debian.tormod@gmail.com>
parents:
3256
diff
changeset
|
55 printf "addr size ty crc name\n" |
3256
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
56 set $mt = *0x44 |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
57 set $mte = *0x46 |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
58 while ($mt < $mte) |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
59 if ((int*)*$mt) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
60 os9_mident (int*)*$mt |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
61 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
62 set $mt += 4 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
63 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
64 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
65 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
66 document os9_mdir |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
67 List all modules registered in module directory. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
68 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
69 |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
70 define os9_mwhich |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
71 set $pc_reg = $arg0 |
3256
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
72 set $mt = *0x44 |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
73 set $mte = *0x46 |
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
74 while ($mt < $mte) |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
75 if ((int*)*$mt) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
76 set $mstart = (int*)*$mt |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
77 set $mend = (char*)$mstart + *($mstart + 1) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
78 if ($pc_reg >= $mstart && $pc_reg < $mend) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
79 loop_break |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
80 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
81 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
82 set $mt += 4 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
83 end |
3256
11d87afc644a
scripts/os9.gdb: Use module directory start/end vectors
Tormod Volden <debian.tormod@gmail.com>
parents:
3046
diff
changeset
|
84 if ($mt == $mte) |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
85 set $mstart = 0 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
86 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
87 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
88 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
89 document os9_mwhich |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
90 (internal) Finds module at given address, sets $mstart quietly. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
91 end |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
92 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
93 define os9_mwhere |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
94 if ($argc == 1) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
95 set $pc_reg = $arg0 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
96 else |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
97 set $pc_reg = $pc |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
98 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
99 os9_mwhich $pc_reg |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
100 if ($mstart) |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
101 printf "inside " |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
102 os9_mname $mstart |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
103 printf "\n" |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
104 eval "!gvim --remote %02X%02X%02X.crc && gvim --remote-send \":set cursorline<CR>\" && gvim --remote-send \"/^%04X<CR>\"", *((char*)$mend-3), *((char*)$mend-2), *((char*)$mend-1), (char*)$pc_reg - (char*)$mstart |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
105 else |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
106 printf "no module\n" |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
107 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
108 end |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
109 |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
110 document os9_mwhere |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
111 Look up source code line for given address. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
112 Requires assembly list files named by CRC in current directory |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
113 and "gvim" to display listing and highlight line. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
114 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
115 |
2955
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
116 define b9 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
117 os9_mwhich $pc |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
118 eval "hbreak *0x%x", (int)$mstart + $arg0 |
a0b770fab355
Add scripts/os9.gdb and list2crc.pl for gdb debugging
Tormod Volden <debian.tormod@gmail.com>
parents:
diff
changeset
|
119 end |
3046
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
120 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
121 document b9 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
122 Set breakpoint in current module, at given offset. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
123 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
124 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
125 define ss |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
126 set $steps = 0 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
127 if (*$pc == 0x103f) |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
128 set $steps = 3 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
129 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
130 if (*(char*)$pc == 0x8d) |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
131 set $steps = 2 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
132 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
133 if (*(char*)$pc == 0x17) |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
134 set $steps = 3 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
135 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
136 if ($steps != 0) |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
137 thbreak *($pc + $steps) |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
138 cont |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
139 else |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
140 stepi |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
141 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
142 end |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
143 |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
144 document ss |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
145 Single step, but skips OS-9 SWI, bsr and lbsr. |
e3e858889ab6
scripts/os9.gdb: Add "smart" single step command
Tormod Volden <debian.tormod@gmail.com>
parents:
2955
diff
changeset
|
146 end |