summaryrefslogtreecommitdiff
path: root/fglrx-gen-breakpoint-shader.sh
blob: 8c525abf576cf4e3f562d49617be33e912049ffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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