From c174ace749bb3603166ab00b543db30cd6b6297b Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Tue, 6 Nov 2012 17:04:09 -0500 Subject: add shader dumping script Signed-off-by: Jerome Glisse --- fglrx-gen-breakpoint-shader.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 fglrx-gen-breakpoint-shader.sh diff --git a/fglrx-gen-breakpoint-shader.sh b/fglrx-gen-breakpoint-shader.sh new file mode 100755 index 0000000..8c525ab --- /dev/null +++ b/fglrx-gen-breakpoint-shader.sh @@ -0,0 +1,18 @@ +#!/bin/sh +addr=`cat .tmp1 | grep fglrx_dri | sed -e 's/^\(0x[0-9a-fA-F]\+\).*/\1/'` +# 0x1983091 was found using valgrind by intercepting write to +# what was identified to be indirect buffer mapped into userspace +# this offset is heavily dependant on which fglrx version you +# are using in this case amd-driver-installer-12-3-x86.x86_64.run or +# amd-driver-installer-12-2-x86.x86_64.run (i dont remember ;)) +shaddr=$(($addr + 0xf83668)) +printf "break *0x%x\n" $shaddr > .tmp2 +echo "commands" >> .tmp2 +echo " set \$idx = 0" >> .tmp2 +echo " while \$idx < \$edx" >> .tmp2 +echo " set \$off = \$idx / 4" >> .tmp2 +echo ' printf "shader[%5d] 0x%08x\n", $off, ((unsigned*)$rsi)[$off]' >> .tmp2 +echo " set \$idx = \$idx + 4" >> .tmp2 +echo " end" >> .tmp2 +echo " continue" >> .tmp2 +echo "end" >> .tmp2 -- cgit v1.2.3