diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/db/.gdbinit	Tue Feb 09 13:44:25 2010 +1030
@@ -0,0 +1,238 @@
+# set args < ~/household/weather/wunderground/2009-11-22 IVICI
+set args < /home/grog/household/weather/BoM/94852-Ballarat/IDV60801.94852.axf
+set complaints 1
+set print pretty
+def xi
+x/10i $eip
+end
+def xs
+x/12x $esp
+end
+def xb
+x/12x $ebp
+end
+def z
+ni
+x/1i $eip
+end
+def zs
+si
+x/1i $eip
+end
+def xp
+echo \ \ \ \ \ \ esp:\ \ 
+output/x $esp
+echo \ (
+output (((int)$ebp)-(int)$esp)/4-4
+echo \ words on stack)\n\ \ \ \ \ \ ebp:\ \ 
+output/x $ebp
+echo \n\ \ \ \ \ \ eip:\ \ 
+x/1i $eip
+echo Saved ebp:\ \ 
+output/x *(int*)$ebp
+echo \ (maximum of\ \  
+output ((*(int*)$ebp)-(int)$ebp)/4-4
+echo \ parameters possible)\nSaved eip:\ \ 
+x/1i *(int*)($ebp+4)
+echo \nParm 1 at\ \ 
+output/x (int) ($ebp+8)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+8)
+echo \nParm 2 at\ \ 
+output/x (int) ($ebp+12)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+12)
+echo \nParm 3 at\ \ 
+output/x (int) ($ebp+16)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+16)
+echo \nParm 4 at\ \ 
+output/x (int) ($ebp+20)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+20)
+echo \n
+end
+def xx
+echo \ \ \ \ \ \ ebp:\ \ 
+output/x vebp
+echo Saved ebp:\ \ 
+output/x *(int*)vebp
+echo \ (maximum of\ \  
+output ((*(int*)vebp)-(int)vebp)/4-4
+echo \ parameters possible)\nSaved eip:\ \ 
+x/1i *(int*)(vebp+4)
+echo \nParm 1 at\ \ 
+output/x (int) (vebp+8)
+echo :\ \ \ \ \ 
+output (char*) *(int*)(vebp+8)
+echo \nParm 2 at\ \ 
+output/x (int) (vebp+12)
+echo :\ \ \ \ \ 
+output (char*) *(int*)(vebp+12)
+echo \nParm 3 at\ \ 
+output/x (int) (vebp+16)
+echo :\ \ \ \ \ 
+output (char*) *(int*)(vebp+16)
+echo \nParm 4 at\ \ 
+output/x (int) (vebp+20)
+echo :\ \ \ \ \ 
+output (char*) *(int*)(vebp+20)
+echo \n
+end
+document xp
+Show the register contents and the first four parameter
+words of the current frame.
+end
+def xxp
+echo \ \ \ \ \ \ esp:\ \ 
+output/x $esp
+echo \n\ \ \ \ \ \ ebp:\ \ 
+output/x $ebp
+echo \n\ \ \ \ \ \ eip:\ \ 
+x/1i $eip
+echo Saved ebp:\ \ 
+output/x *(int*)$ebp
+echo \ (maximum of\ \  
+output ((*(int*)$ebp)-(int)$ebp)/4-4
+echo \ parameters possible)\nSaved eip:\ \ 
+x/1i *(int*)($ebp+4)
+echo \nParm  1 at\ \ 
+output/x (int) ($ebp+8)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+8)
+echo \nParm  2 at\ \ 
+output/x (int) ($ebp+12)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+12)
+echo \nParm  3 at\ \ 
+output/x (int) ($ebp+16)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+16)
+echo \nParm  4 at\ \ 
+output/x (int) ($ebp+20)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+20)
+echo \nParm  5 at\ \ 
+output/x (int) ($ebp+24)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+24)
+echo \nParm  6 at\ \ 
+output/x (int) ($ebp+28)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+28)
+echo \nParm  7 at\ \ 
+output/x (int) ($ebp+32)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+32)
+echo \nParm  8 at\ \ 
+output/x (int) ($ebp+36)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+36)
+echo \nParm  9 at\ \ 
+output/x (int) ($ebp+40)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+40)
+echo \nParm 10 at\ \ 
+output/x (int) ($ebp+44)
+echo :\ \ \ \ \ 
+output (char*) *(int*)($ebp+44)
+echo \n
+end
+document xxp
+Show the register contents and the first ten parameter
+words of the current frame.
+end
+def xp0
+x/12x *(int*)$esp
+p *(int*)$esp
+p (char*)*$esp
+end
+def xp1
+x/12x *(int*)($ebp+4)
+p *(int*)($ebp+4)
+p (char**)($ebp+4)
+end
+def xp2
+x/12x *(int*)($ebp+8)
+p *(int*)($ebp+8)
+p *(char**)($ebp+8)
+end
+def xp3
+x/12x *(int*)($ebp+12)
+p *(int*)($ebp+12)
+p (char**)($ebp+12)
+end
+def xp4
+x/12x *(int*)($ebp+16)
+p *(int*)($ebp+16)
+p (char**)($ebp+16)
+end
+document xp0
+Show the first parameter of current stack frame in various formats
+end
+document xp1
+Show the second parameter of current stack frame in various formats
+end
+document xp2
+Show the third parameter of current stack frame in various formats
+end
+document xp3
+Show the fourth parameter of current stack frame in various formats
+end
+document xp4
+Show the fifth parameter of current stack frame in various formats
+end
+def f0
+f 0
+xp
+end
+def f1
+f 1
+xp
+end
+def f2
+f 2
+xp
+end
+def f3
+f 3
+xp
+end
+def f4
+f 4
+xp
+end
+def f5
+f 5
+xp
+end
+document f0
+Select stack frame 0 and show assembler-level details
+end
+document f1
+Select stack frame 1 and show assembler-level details
+end
+document f2
+Select stack frame 2 and show assembler-level details
+end
+document f3
+Select stack frame 3 and show assembler-level details
+end
+document f4
+Select stack frame 4 and show assembler-level details
+end
+document f5
+Select stack frame 5 and show assembler-level details
+end
+document z
+Single step 1 instruction (over calls) and show next instruction.
+end
+document xi
+List the next 10 instructions from the current IP value
+end
+document xs
+Show the last 12 words on stack in hex
+end
+document xb
+Show 12 words starting at current BP value in hex
+end