From 17eeb1a44801f4e56131df4a8c5c2f164914816c Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Thu, 26 Jan 2023 16:53:42 +0100 Subject: [PATCH] Increment the counters --- gdb-port/top-level-parse.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index db79225..077731c 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -74,6 +74,7 @@ class TopLevelParse: parser_obj = Parser(None, parser) self.parser_objs[parser] = parser_obj self.h_do_parse_parser = parser_obj # TODO: current_parser_env should be set here instead too + parser_obj.increment_apply_count() if parser_stack.parse_state is None and parser_stack.parse_state != parse_state: self.first_h_do_parse_after_packrat_parse(parse_state, arena) @@ -84,6 +85,10 @@ class TopLevelParse: # Parsers are only pushed on the stack in perform_lowlevel_parse, which doesn't get called when h_do_parse() gets the result from cache. # If other backends are supported, this might change to pushing/popping the stack in h_do_parse() self.h_do_parse_parser = parser_obj # Restore the "current" parser, otherwise it'll show the parser h_do_parse() was last called with on the GUI and backtrace + if ret_val: + parser_obj.increment_successful_parse_count() + else: + parser_obj.increment_failed_parse_count() if self.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: #if self.extended_arena_stats_available(): # DEBUG -- GitLab