From f3f69c613eb9b442bf32a67476be02f5b324bad4 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 30 Nov 2008 20:34:01 -0500 Subject: [PATCH] The StackFrame index will always be 0 in -[GDBpConnection createStackFrame], so we need to advance it in -[StackController pop] and -[push:] * Source/GDBpConnection.m: (createStackFrame): Don't bother getting the "level" property, it will always be 0 * Source/StackController.m: (pop): Decrease all of the frames' counter (push:): Increase all of the frames' counter --- Source/GDBpConnection.m | 2 +- Source/StackController.m | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index 2219bb1..ea78ee4 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -343,7 +343,7 @@ NSXMLElement *xmlframe = [[[doc rootElement] children] objectAtIndex:0]; StackFrame *frame = [[StackFrame alloc] - initWithIndex:[[[xmlframe attributeForName:@"level"] stringValue] intValue] + initWithIndex:0 withFilename:[[xmlframe attributeForName:@"filename"] stringValue] withSource:nil atLine:[[[xmlframe attributeForName:@"lineno"] stringValue] intValue] diff --git a/Source/StackController.m b/Source/StackController.m index 0109c41..69261c4 100644 --- a/Source/StackController.m +++ b/Source/StackController.m @@ -56,8 +56,13 @@ - (StackFrame *)pop { StackFrame *frame = [stack lastObject]; + if (frame != nil) [stack removeLastObject]; + + for (StackFrame *f in stack) + f.index--; + return frame; } @@ -66,6 +71,9 @@ */ - (void)push:(StackFrame *)frame { + for (StackFrame *f in stack) + f.index++; + [stack insertObject:frame atIndex:[stack count]]; } -- 2.22.5