From cc1f7dc0ae76c1c708d1a4773c8b8e7a342e3a66 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 19 Jun 2010 12:14:23 -0400 Subject: [PATCH] * In StackController, don't update the frame indices when |-push:|- or |-pop|-ing. * Only retreive full stack frame information for frame 0. The other frames will be fetched lazily. --- Source/DebuggerProcessor.m | 26 +++++++++++++++----------- Source/StackController.m | 8 +------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Source/DebuggerProcessor.m b/Source/DebuggerProcessor.m index 32eea93..d51b6e6 100644 --- a/Source/DebuggerProcessor.m +++ b/Source/DebuggerProcessor.m @@ -314,17 +314,21 @@ atLine:[[[xmlframe attributeForName:@"lineno"] stringValue] intValue] inFunction:[[xmlframe attributeForName:@"where"] stringValue] withVariables:nil]; - - // Get the source code of the file. Escape % in URL chars. - NSString* escapedFilename = [frame.filename stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; - NSNumber* transaction = [connection_ sendCommandWithFormat:@"source -f %@", escapedFilename]; - [self recordCallback:@selector(setSource:) forTransaction:transaction]; - [callbackContext_ setObject:routingNumber forKey:transaction]; - - // Get the names of all the contexts. - transaction = [connection_ sendCommandWithFormat:@"context_names -d %d", frame.index]; - [self recordCallback:@selector(contextsReceived:) forTransaction:transaction]; - [callbackContext_ setObject:routingNumber forKey:transaction]; + + // Only get the complete frame for the first level. The other frames will get + // information loaded lazily when the user clicks on one. + if (frame.index == 0) { + // Get the source code of the file. Escape % in URL chars. + NSString* escapedFilename = [frame.filename stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; + NSNumber* transaction = [connection_ sendCommandWithFormat:@"source -f %@", escapedFilename]; + [self recordCallback:@selector(setSource:) forTransaction:transaction]; + [callbackContext_ setObject:routingNumber forKey:transaction]; + + // Get the names of all the contexts. + transaction = [connection_ sendCommandWithFormat:@"context_names -d %d", frame.index]; + [self recordCallback:@selector(contextsReceived:) forTransaction:transaction]; + [callbackContext_ setObject:routingNumber forKey:transaction]; + } if ([delegate respondsToSelector:@selector(newStackFrame:)]) [delegate newStackFrame:frame]; diff --git a/Source/StackController.m b/Source/StackController.m index b280e91..a488b5b 100644 --- a/Source/StackController.m +++ b/Source/StackController.m @@ -59,10 +59,7 @@ if (frame != nil) [stack removeLastObject]; - - for (StackFrame* f in stack) - f.index--; - + return frame; } @@ -71,9 +68,6 @@ */ - (void)push:(StackFrame*)frame { - for (StackFrame* f in stack) - f.index++; - [stack insertObject:frame atIndex:[stack count]]; } -- 2.22.5