self.element_start('trace')
while self.token.type not in (ELEMENT_END, EOF):
call = self.parse_call()
- if not self.options.ignore_junk or not trace_call_ignore(call):
- self.handle_call(call)
+ call.is_junk = trace_call_ignore(call)
+ self.handle_call(call)
if self.token.type != EOF:
self.element_end('trace')
self.pretty_printer = PrettyPrinter(self.formatter, options)
def handle_call(self, call):
+ if self.options.ignore_junk and call.is_junk:
+ return
+
call.visit(self.pretty_printer)
self.call_stack = []
def handle_call(self, call):
+ if self.options.ignore_junk and call.is_junk:
+ return
+
if self.options.named_ptrs:
self.call_stack.append(call)
else:
### Perform diffing
pkk_info("Matching trace sequences ...")
- sequence = difflib.SequenceMatcher(None, stack1, stack2, autojunk=False)
+ sequence = difflib.SequenceMatcher(lambda x : x.is_junk, stack1, stack2, autojunk=False)
pkk_info("Sequencing diff ...")
opcodes = sequence.get_opcodes()
while True:
# Get line data
if ncall1 < end1:
- printer.entry_start(show_args)
- stack1[ncall1].visit(printer)
- data1 = printer.entry_get()
+ if not options.ignore_junk or not stack1[ncall1].is_junk:
+ printer.entry_start(show_args)
+ stack1[ncall1].visit(printer)
+ data1 = printer.entry_get()
+ else:
+ data1 = []
ncall1 += 1
else:
data1 = []
last1 = True
if ncall2 < end2:
- printer.entry_start(show_args)
- stack2[ncall2].visit(printer)
- data2 = printer.entry_get()
+ if not options.ignore_junk or not stack2[ncall2].is_junk:
+ printer.entry_start(show_args)
+ stack2[ncall2].visit(printer)
+ data2 = printer.entry_get()
+ else:
+ data2 = []
ncall2 += 1
else:
data2 = []