You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
331 B

#!/usr/bin/python
import re
import os
fd = os.popen("avr-objdump -d firmware.bin")
regcount = [0]*32
s="foo"
while s:
s=fd.readline()
m=re.findall(r"[ \n\t,;]r(\d\d?)[ \n\t,;]",s)
if m:
for i in m:
regcount[int(i)] += 1;
for i in range(16):
print "r%2d: %4d"%(i,regcount[i]),
print "\tr%2d: %4d"%(i+16,regcount[i+16])