Mercurial > hg > python
view ptrace.py @ 16:a7a10e40b344
5a working after obvious bugfix,
indenting debug print,
10a inf. loop
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Tue, 24 Mar 2020 18:57:33 +0000 |
parents | fee51ab07d09 |
children |
line wrap: on
line source
#!/usr/bin/python # usage: ptrace.py TRACE [result of nm xemacs | egrep '[$_]'] import sys symfile=open(sys.argv[2]) syms={} for l in symfile: (addr,rest)=l.rstrip().split(' ',1) syms[addr]=rest symfile.close() trfile=open(sys.argv[1]) for l in trfile: (what,rest)=l.rstrip().split(' ',1) if what in ('incipit','exit','p'): print l.rstrip() continue (where,when)=rest.split() try: (z,b)=where.split('x') print "%8s %s %s"%(what,syms["00"+b],when) except: print "not hex: ",l.rstrip() trfile.close()