diff --git a/gdb-port/parser.py b/gdb-port/parser.py index db6fccd7b04138800ca31bfe5c954b71887333ad..515018b211b0950490c1c4584598377208ffab06 100644 --- a/gdb-port/parser.py +++ b/gdb-port/parser.py @@ -238,6 +238,8 @@ class ParserStack: stack_depth -= 1 if stack_depth == 0: stack_events = self.stack_events[-index-1:] + # Possible optimization: + # Get only self.stack_events[-1], self.stack_events[-2], self.stack_events[-index-1], self.stack_events[-index] print(stack_events) # DEBUG break @@ -246,6 +248,7 @@ class ParserStack: def compute_outer_frame(self, stack_slice): if len(stack_slice) == 2: return stack_slice[1][1] - stack_slice[0][1] + # The code below assumes len(stack_slice) >= 4, TODO: ensure that len(stack_slice) is never 3 else: # Remove the "outer" frame, call the function recursively on the "inner" frames #new_slice = stack_slice[1:-1]