* In StackController, don't update the frame indices when |-push:|- or |-pop|-ing.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 19 Jun 2010 16:14:23 +0000 (12:14 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 19 Jun 2010 16:14:23 +0000 (12:14 -0400)
* Only retreive full stack frame information for frame 0. The other frames will be fetched lazily.

Source/DebuggerProcessor.m
Source/StackController.m

index 32eea939c0e953c37628d99daab4626c998db5d5..d51b6e631ecb349632224f72c9169b74a615b307 100644 (file)
                                  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];
index b280e91426c81445939229628087602fe90e2c11..a488b5b037e99ece82552b1388de8a51a6d11410 100644 (file)
        
        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]];
 }