From cfd98324a584e41979cea818d8346f94be047570 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Mon, 15 May 2023 16:51:36 +0200 Subject: [PATCH] Fix attempting to add memory use to parser at address 0x0 --- gdb-port/parser.py | 2 +- gdb-port/top-level-parse.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/gdb-port/parser.py b/gdb-port/parser.py index 2d91840..1bb87dc 100644 --- a/gdb-port/parser.py +++ b/gdb-port/parser.py @@ -91,7 +91,7 @@ class ParserStack: self.p_stack = [] self.unclaimed_mem_use = 0 self.stack_events = [] - self.pending_allocs = { self.arena_int : {} } + self.pending_allocs = { } # Represents the index of a "waterline" on the stack_events for the purpose of counting allocations # This is the index of the last event (stack push or pop) where the relevant allocations have been committed to TopLevelParse's memory stats. # Due to the semantics of stack events, this means that if self.committed points to a push event, nothing in that "frame" has been committed yet. if it points to a pop event, everything in that "frame" has been committed diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index d9e62fb..77e553f 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -276,8 +276,6 @@ class TopLevelParse: for ps in self.parser_stacks: new_allocs_by_parser = ps.get_pending_allocations() for parser, alloc in new_allocs_by_parser.items(): - if not parser: # DEBUG - continue # DEBUG pending_allocs = self.pending_allocs.get(parser, {}) pending_allocs[ps.arena_int] = pending_allocs.get(ps.arena_int, 0) + alloc.get(ps.arena_int, 0) self.pending_allocs[parser] = pending_allocs -- GitLab