X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=inline;f=.gdbinit;h=f6991f6cf3368c4fd488a5b4e8394bc586f1fd70;hb=HEAD;hp=08958302c5fafbcff1e1c0b3eed755d6d3b96589;hpb=d24159b0c83a8f8f527ddb2a157b8806b53efb14;p=home.git
diff --git a/.gdbinit b/.gdbinit
index 0895830..f6991f6 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,5 +1,12 @@
+# Load dynamic Python code first.
+source ~/.gdbinit.py
+
+#
+# Base settings.
+#
+
set print pretty on
-set prompt [30;1m([34;1mgdb[30;1m)[0m
+set prompt [30;1m([34;1mgdb[30;1m) [0m
set history save on
set pagination off
set output-radix 16
@@ -9,50 +16,128 @@ set remotetimeout 300
#catch fork
#catch vfork
-define exit
- quit
+#
+# U-Boot style memory compare functions
+#
+
+define _cmp
+ set $$base = (unsigned long)$arg0
+ set $$addr1 = $arg0
+ set $$addr2 = $arg1
+ set $$count = $arg2
+ while $$count-- > 0
+ if (*$$addr1 != *$$addr2)
+ printf "Data mismatch at %#x units (@%#x != @%#x)\n", $arg2, $$addr1, $$addr2
+ set $$count = -100
+ end
+ set $$addr1 += 1
+ set $$addr2 += 1
+ end
+ if $$count == -1
+ printf "Data matches for %#x units\n", $arg2
+ end
+ dont-repeat
+end
+document _cmp
+Usage: cmp[bwl]
+Compare between and .
end
-define peedi
- target remote peedi:2000
+define cmpb
+ if $argc == 3
+ set $$addr1 = (unsigned char *)$arg0
+ set $$addr2 = (unsigned char *)$arg1
+ _cmp $$addr1 $$addr2 $arg2
+ else
+ help _cmp
+ end
end
-define jtag
- target remote localhost:2000
+document cmpb
+Use 'help _cmp'
end
-define kgdboc
- set remotebaud 57600
- if $argc == 0
- target remote /dev/ttyS0
+define cmpw
+ if $argc == 3
+ set $$addr1 = (unsigned short *)$arg0
+ set $$addr2 = (unsigned short *)$arg1
+ _cmp $$addr1 $$addr2 $arg2
else
- target remote /dev/tty$arg0
+ help _cmp
end
end
-define kgdbocusb
- kgdboc USB0
+document cmpw
+Use 'help _cmp'
+end
+define cmpl
+ if $argc == 3
+ set $$addr1 = (unsigned long *)$arg0
+ set $$addr2 = (unsigned long *)$arg1
+ _cmp $$addr1 $$addr2 $arg2
+ else
+ help _cmp
+ end
end
-define kgdboe
- target remote udp:bfin:6443
+document cmpl
+Use 'help _cmp'
end
-define vapier
- target remote vapier:2000
+
+
+#
+# U-Boot style memory copy functions
+#
+
+define _cp
+ set $$src = $arg0
+ set $$dst = $arg1
+ set $$count = $arg2
+ while $$count-- > 0
+ set *$$dst = *$$src
+ set $$src += 1
+ set $$dst += 1
+ end
+ printf "Copied %#x units from %#x to %#x\n", $arg2, $arg0, $arg1
+ dont-repeat
end
-define bfin
- target remote bfin:1234
+document _cp
+Usage: cp[bwl]
+Copy from to .
end
-define dis
- if $argc == 0
- disassemble $pc ($pc + 0x40)
+define cpb
+ if $argc == 3
+ set $$addr1 = (unsigned char *)$arg0
+ set $$addr2 = (unsigned char *)$arg1
+ _cp $$addr1 $$addr2 $arg2
+ else
+ help _cp
+ end
+end
+document cpb
+Use 'help _cp'
+end
+define cpw
+ if $argc == 3
+ set $$addr1 = (unsigned short *)$arg0
+ set $$addr2 = (unsigned short *)$arg1
+ _cp $$addr1 $$addr2 $arg2
+ else
+ help _cp
end
- if $argc == 1
- disassemble $arg0 ($arg0 + 0x40)
+end
+document cpw
+Use 'help _cp'
+end
+define cpl
+ if $argc == 3
+ set $$addr1 = (unsigned long *)$arg0
+ set $$addr2 = (unsigned long *)$arg1
+ _cp $$addr1 $$addr2 $arg2
+ else
+ help _cp
end
end
-define go
- jump *$arg0
+document cpl
+Use 'help _cp'
end
-source /usr/local/src/blackfin/svn/toolchain/trunk/debug-helpers/gdb-scripts/bfin
-source /usr/local/src/blackfin/svn/toolchain/trunk/debug-helpers/gdb-scripts/u-boot
-source /usr/local/src/blackfin/git/toolchain/debug-helpers/gdb-scripts/bfin
-source /usr/local/src/blackfin/git/toolchain/debug-helpers/gdb-scripts/u-boot
+
+#set extended-prompt \[\e[30;1m\](\[\e[34;1m\]gdb\[\e[30;1m\]) \[\e[0m\]