class Call:
- def __init__(self, klass, method, args, ret):
+ def __init__(self, no, klass, method, args, ret):
+ self.no = no
self.klass = klass
self.method = method
self.args = args
self.formatter.address(node.address)
def visit_call(self, node):
+ self.formatter.text('%s ' % node.no)
if node.klass is not None:
self.formatter.function(node.klass + '::' + node.method)
else:
class TraceParser(XmlParser):
+ def __init__(self, fp):
+ XmlParser.__init__(self, fp)
+ self.last_call_no = 0
+
def parse(self):
self.element_start('trace')
while self.token.type not in (ELEMENT_END, EOF):
def parse_call(self):
attrs = self.element_start('call')
+ try:
+ no = int(attrs['no'])
+ except KeyError:
+ self.last_call_no += 1
+ no = self.last_call_no
+ else:
+ self.last_call_no = no
klass = attrs['class']
method = attrs['method']
args = []
raise TokenMismatch("<arg ...> or <ret ...>", self.token)
self.element_end('call')
- return Call(klass, method, args, ret)
+ return Call(no, klass, method, args, ret)
def parse_arg(self):
attrs = self.element_start('arg')