Don't fetch source in |-[DebuggerBackEnd loadStackFrame:]| for empy filenames.
authorRobert Sesek <rsesek@bluestatic.org>
Fri, 24 Dec 2010 16:29:13 +0000 (11:29 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Fri, 24 Dec 2010 16:29:13 +0000 (11:29 -0500)
Doing so wedges the write queue because the error comes back without a transasction ID.

Source/DebuggerBackEnd.m

index 8e6c53c99aa799dc191600329a5264992b422b53..42d8f88ad1e2d7bc094389f76a93ef06a225ceb3 100644 (file)
     return;
 
   NSNumber* routingNumber = [NSNumber numberWithInt:frame.routingID];
+  NSNumber* transaction = 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];
+  if ([frame.filename length]) {
+    NSString* escapedFilename = [frame.filename stringByReplacingOccurrencesOfString:@"%" withString:@"%%"];
+    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];