view ptrace.py @ 59:c22f83e049a9 simple

check0 works for nono10, but is broken in that col 3 w/o the row 7 hit would find the row 3 hit as satisfying the last (2nd) run, which isn't _necessarily_ correct
author Henry Thompson <ht@markup.co.uk>
date Sat, 03 Jun 2023 22:11:12 +0100
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()