comparison db/.gdbinit @ 0:9dab44dcb331

Initial commit of Greg's code from http://www.lemis.com/grog/tmp/wh1080.tar.gz
author Daniel O'Connor <darius@dons.net.au>
date Tue, 09 Feb 2010 13:44:25 +1030
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9dab44dcb331
1 # set args < ~/household/weather/wunderground/2009-11-22 IVICI
2 set args < /home/grog/household/weather/BoM/94852-Ballarat/IDV60801.94852.axf
3 set complaints 1
4 set print pretty
5 def xi
6 x/10i $eip
7 end
8 def xs
9 x/12x $esp
10 end
11 def xb
12 x/12x $ebp
13 end
14 def z
15 ni
16 x/1i $eip
17 end
18 def zs
19 si
20 x/1i $eip
21 end
22 def xp
23 echo \ \ \ \ \ \ esp:\ \
24 output/x $esp
25 echo \ (
26 output (((int)$ebp)-(int)$esp)/4-4
27 echo \ words on stack)\n\ \ \ \ \ \ ebp:\ \
28 output/x $ebp
29 echo \n\ \ \ \ \ \ eip:\ \
30 x/1i $eip
31 echo Saved ebp:\ \
32 output/x *(int*)$ebp
33 echo \ (maximum of\ \
34 output ((*(int*)$ebp)-(int)$ebp)/4-4
35 echo \ parameters possible)\nSaved eip:\ \
36 x/1i *(int*)($ebp+4)
37 echo \nParm 1 at\ \
38 output/x (int) ($ebp+8)
39 echo :\ \ \ \ \
40 output (char*) *(int*)($ebp+8)
41 echo \nParm 2 at\ \
42 output/x (int) ($ebp+12)
43 echo :\ \ \ \ \
44 output (char*) *(int*)($ebp+12)
45 echo \nParm 3 at\ \
46 output/x (int) ($ebp+16)
47 echo :\ \ \ \ \
48 output (char*) *(int*)($ebp+16)
49 echo \nParm 4 at\ \
50 output/x (int) ($ebp+20)
51 echo :\ \ \ \ \
52 output (char*) *(int*)($ebp+20)
53 echo \n
54 end
55 def xx
56 echo \ \ \ \ \ \ ebp:\ \
57 output/x vebp
58 echo Saved ebp:\ \
59 output/x *(int*)vebp
60 echo \ (maximum of\ \
61 output ((*(int*)vebp)-(int)vebp)/4-4
62 echo \ parameters possible)\nSaved eip:\ \
63 x/1i *(int*)(vebp+4)
64 echo \nParm 1 at\ \
65 output/x (int) (vebp+8)
66 echo :\ \ \ \ \
67 output (char*) *(int*)(vebp+8)
68 echo \nParm 2 at\ \
69 output/x (int) (vebp+12)
70 echo :\ \ \ \ \
71 output (char*) *(int*)(vebp+12)
72 echo \nParm 3 at\ \
73 output/x (int) (vebp+16)
74 echo :\ \ \ \ \
75 output (char*) *(int*)(vebp+16)
76 echo \nParm 4 at\ \
77 output/x (int) (vebp+20)
78 echo :\ \ \ \ \
79 output (char*) *(int*)(vebp+20)
80 echo \n
81 end
82 document xp
83 Show the register contents and the first four parameter
84 words of the current frame.
85 end
86 def xxp
87 echo \ \ \ \ \ \ esp:\ \
88 output/x $esp
89 echo \n\ \ \ \ \ \ ebp:\ \
90 output/x $ebp
91 echo \n\ \ \ \ \ \ eip:\ \
92 x/1i $eip
93 echo Saved ebp:\ \
94 output/x *(int*)$ebp
95 echo \ (maximum of\ \
96 output ((*(int*)$ebp)-(int)$ebp)/4-4
97 echo \ parameters possible)\nSaved eip:\ \
98 x/1i *(int*)($ebp+4)
99 echo \nParm 1 at\ \
100 output/x (int) ($ebp+8)
101 echo :\ \ \ \ \
102 output (char*) *(int*)($ebp+8)
103 echo \nParm 2 at\ \
104 output/x (int) ($ebp+12)
105 echo :\ \ \ \ \
106 output (char*) *(int*)($ebp+12)
107 echo \nParm 3 at\ \
108 output/x (int) ($ebp+16)
109 echo :\ \ \ \ \
110 output (char*) *(int*)($ebp+16)
111 echo \nParm 4 at\ \
112 output/x (int) ($ebp+20)
113 echo :\ \ \ \ \
114 output (char*) *(int*)($ebp+20)
115 echo \nParm 5 at\ \
116 output/x (int) ($ebp+24)
117 echo :\ \ \ \ \
118 output (char*) *(int*)($ebp+24)
119 echo \nParm 6 at\ \
120 output/x (int) ($ebp+28)
121 echo :\ \ \ \ \
122 output (char*) *(int*)($ebp+28)
123 echo \nParm 7 at\ \
124 output/x (int) ($ebp+32)
125 echo :\ \ \ \ \
126 output (char*) *(int*)($ebp+32)
127 echo \nParm 8 at\ \
128 output/x (int) ($ebp+36)
129 echo :\ \ \ \ \
130 output (char*) *(int*)($ebp+36)
131 echo \nParm 9 at\ \
132 output/x (int) ($ebp+40)
133 echo :\ \ \ \ \
134 output (char*) *(int*)($ebp+40)
135 echo \nParm 10 at\ \
136 output/x (int) ($ebp+44)
137 echo :\ \ \ \ \
138 output (char*) *(int*)($ebp+44)
139 echo \n
140 end
141 document xxp
142 Show the register contents and the first ten parameter
143 words of the current frame.
144 end
145 def xp0
146 x/12x *(int*)$esp
147 p *(int*)$esp
148 p (char*)*$esp
149 end
150 def xp1
151 x/12x *(int*)($ebp+4)
152 p *(int*)($ebp+4)
153 p (char**)($ebp+4)
154 end
155 def xp2
156 x/12x *(int*)($ebp+8)
157 p *(int*)($ebp+8)
158 p *(char**)($ebp+8)
159 end
160 def xp3
161 x/12x *(int*)($ebp+12)
162 p *(int*)($ebp+12)
163 p (char**)($ebp+12)
164 end
165 def xp4
166 x/12x *(int*)($ebp+16)
167 p *(int*)($ebp+16)
168 p (char**)($ebp+16)
169 end
170 document xp0
171 Show the first parameter of current stack frame in various formats
172 end
173 document xp1
174 Show the second parameter of current stack frame in various formats
175 end
176 document xp2
177 Show the third parameter of current stack frame in various formats
178 end
179 document xp3
180 Show the fourth parameter of current stack frame in various formats
181 end
182 document xp4
183 Show the fifth parameter of current stack frame in various formats
184 end
185 def f0
186 f 0
187 xp
188 end
189 def f1
190 f 1
191 xp
192 end
193 def f2
194 f 2
195 xp
196 end
197 def f3
198 f 3
199 xp
200 end
201 def f4
202 f 4
203 xp
204 end
205 def f5
206 f 5
207 xp
208 end
209 document f0
210 Select stack frame 0 and show assembler-level details
211 end
212 document f1
213 Select stack frame 1 and show assembler-level details
214 end
215 document f2
216 Select stack frame 2 and show assembler-level details
217 end
218 document f3
219 Select stack frame 3 and show assembler-level details
220 end
221 document f4
222 Select stack frame 4 and show assembler-level details
223 end
224 document f5
225 Select stack frame 5 and show assembler-level details
226 end
227 document z
228 Single step 1 instruction (over calls) and show next instruction.
229 end
230 document xi
231 List the next 10 instructions from the current IP value
232 end
233 document xs
234 Show the last 12 words on stack in hex
235 end
236 document xb
237 Show 12 words starting at current BP value in hex
238 end