# Target the Blackfin GDB Proxy, runs on 2000 by default.
target remote :2000

define tvm_dump
printf  "Transterpreter state\n--------------------\n"
printf "areg %08X\n", areg
printf "breg %08X\n", breg
printf "creg %08X\n", creg
printf "-------------\n"
printf "iptr %08X\n", iptr
printf "wptr %08X\n", wptr
printf "-------------\n"
printf "[0] %08X\n", transputermem[0]
printf "[1] %08X\n", transputermem[1]
printf "[2] %08X\n", transputermem[2]
printf "[3] %08X\n", transputermem[3]
printf "-------------\n"
printf "wptr-4 %08X [%08X]\n", (wptr-4), *(wptr-4)
printf "wptr-3 %08X [%08X]\n", (wptr-3), *(wptr-3)
printf "wptr-2 %08X [%08X]\n", (wptr-2), *(wptr-2)
printf "wptr-1 %08X [%08X]\n", (wptr-1), *(wptr-1)
printf "wptr   %08X [%08X]\n", wptr, *wptr
printf "wptr+1 %08X [%08X]\n", (wptr+1), *(wptr+1)
printf "wptr+2 %08X [%08X]\n", (wptr+2), *(wptr+2)
printf "wptr+3 %08X [%08X]\n", (wptr+3), *(wptr+3)
printf "wptr+4 %08X [%08X]\n", (wptr+4), *(wptr+4)
end

document tvm_dump
Dump Transterpreter state
end

define print_us
	set $start=$arg0
	set $end=$start+$arg1
	set $i=$start
	while $i < $end	
		printf "%02X ", *(userspace_start+$i)
	  	set $i=$i+1	
	end
	printf "\n"
end

document print_us
print_us <START> <NUM BYTES>
Prints userspace bytes.
end


