7 print "Usage: parse_symbols.py file.sym"
15 # parse .sym file and fill a list
21 address, type, name = l[:-1].split(' ')
25 # print "%x %s"%(int(address,16),name)
26 symlist.append([int(address, 16), name, 0])
32 l=sys.stdin.readline()
44 while i < len(symlist):
45 address, name, cpt = symlist[i]
52 # address cannot be in last symbols, so we
53 # suppose it is not found
55 print "Cannot find symbol"
58 symlist.sort(cmp=lambda x,y:x[2]<y[2] and 1 or -1)
61 address, name, cpt = sym
64 print "%2.2f%% (%.3d/%.3d) %s[%.8x]"%( (float(cpt)*100.)/global_cpt, cpt,
65 global_cpt, name, address)