diff --git a/gdb-port/parser.py b/gdb-port/parser.py index 2d7d0dd7f808e5611fb7902a73b530a11c9425be..636cb596e8aaea02fcc19ebbc91a89ca4c9805a2 100644 --- a/gdb-port/parser.py +++ b/gdb-port/parser.py @@ -97,7 +97,7 @@ class ParserStack: self.partial_alloc_counts.append(None) if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: #TODO: check that self.arena is same as gdb.selected_frame()'s arena - self.bytes_at_enter.append(int(self.arena['arena_malloc_bytes'])) + self.bytes_at_enter.append(int(self.arena_gdbval['arena_malloc_bytes'])) self.cumulative_byte_differences = [] prev = 0 if len(self.bytes_at_enter) > 1: @@ -118,7 +118,7 @@ class ParserStack: if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: #if self.extended_arena_stats_available(): # DEBUG #import code; code.interact(local=locals()) # DEBUG - newbytes = int(self.parse_state['arena']['arena_malloc_bytes']) + newbytes = int(self.parse_state_gdbval['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 self.total_byte_differences.insert(-len(self.cumulative_byte_differences), allocated_bytes) diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index 5e9d22fc6d7b47c83b8675d8898b3abc7aa79a88..1d2294154482de4f21d53266116fa6f0f6e8dc89 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -61,9 +61,10 @@ class TopLevelParse: def enter_h_do_parse(self, parse_state, arena, parser): parser_stack = self.peek_parserstack() if parser_stack.arena is None: - parser_stack.arena = arena + parser_stack.arena_gdbval = arena if parser_stack.parse_state is None: - parser_stack.parse_state = parse_state + parser_stack.parse_state_gdbval = parse_state + # TODO: if we can set things here, first_h_do_parse_after_packrat_parse() may be entirely unnecessary try: parser_obj = self.parser_objs[parser]