diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-11-06 17:04:09 -0500 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2012-11-06 12:08:35 -0500 |
commit | c174ace749bb3603166ab00b543db30cd6b6297b (patch) | |
tree | 73cd7c2895fb8692c796031b886ca24e5ef92b9a | |
parent | e1624e077c92bc5992b343d707ff88c371da238a (diff) |
add shader dumping script
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
-rwxr-xr-x | fglrx-gen-breakpoint-shader.sh | 18 |
1 files changed, 18 insertions, 0 deletions
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 |