From 767c5ee314ee316c5fe2b1864da936bcba17597f Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Thu, 26 Jan 2023 14:40:32 +0100 Subject: [PATCH] Restore debug behavior again --- gdb-port/top-level-parse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index e981142..db79225 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -63,8 +63,8 @@ class TopLevelParse: def enter_h_do_parse(self, parse_state, arena, parser): parser_stack = self.peek_parserstack() - #if self.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS - if self.extended_arena_stats_available(): # DEBUG + if self.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: + #if self.extended_arena_stats_available(): # DEBUG self.bytes_at_enter.append(int(arena['arena_malloc_bytes'])) self.cumulative_byte_differences = [] # TODO: direction @@ -85,8 +85,8 @@ class TopLevelParse: # 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 self.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS - if self.extended_arena_stats_available(): # DEBUG + if self.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: + #if self.extended_arena_stats_available(): # DEBUG newbytes = int(parse_state['arena']['arena_malloc_bytes']) self.cumulative_byte_differences.insert(0, newbytes - self.bytes_at_enter[-(len(self.cumulative_byte_differences)+1)]) # TODO: consistency. this is the third way of answering the question, "how deep are we in the stack" allocated_bytes = self.cumulative_byte_differences[-len(self.cumulative_byte_differences)] - self.cumulative_byte_differences[-(len(self.cumulative_byte_differences)-1)] # NB: len(self.cumulative_byte_differences) changed since the last line -- GitLab