@interface DebuggerController (Private)
- (void)updateSourceViewer;
- (void)updateStackViewer;
+- (void)expandVariables;
@end
@implementation DebuggerController
[self setError:[[notif userInfo] valueForKey:@"NSString"]];
}
-/**
- * Sets the stack root element so that the NSOutlineView can display it
- */
-- (void)setRegister:(NSXMLDocument *)elm
-{
- // XXX: Doing anything short of this will cause bindings to crash spectacularly for no reason whatsoever, and
- // in seemingly arbitrary places. The class that crashes is _NSKeyValueObservationInfoCreateByRemoving.
- // http://boredzo.org/blog/archives/2006-01-29/have-you-seen-this-crash says that this means nothing is
- // being observed, but I doubt that he was using an NSOutlineView which seems to be one f!cking piece of
- // sh!t when used with NSTreeController. http://www.cocoadev.com/index.pl?NSTreeControllerBugOrDeveloperError
- // was the inspiration for this fix (below) but the author says that inserting does not work too well, but
- // that's okay for us as we just need to replace the entire thing.
- [registerController setContent:nil];
- [registerController setContent:[[elm rootElement] children]];
-
- for (int i = 0; i < [registerView numberOfRows]; i++)
- {
- NSTreeNode *node = [registerView itemAtRow:i];
- if ([expandedRegisters containsObject:[[node representedObject] fullname]])
- {
- [registerView expandItem:node];
- }
- }
-}
-
/**
* Forwards the message to run script execution to the connection
*/
- (void)tableViewSelectionDidChange:(NSNotification *)notif
{
[self updateSourceViewer];
+ [self expandVariables];
}
/**
{
[stackArrayController rearrangeObjects];
[stackArrayController setSelectionIndex:0];
+ [self expandVariables];
+}
+
+/**
+ * Expands the variables based on the stored set
+ */
+- (void)expandVariables
+{
+ for (int i = 0; i < [registerView numberOfRows]; i++)
+ {
+ NSTreeNode *node = [registerView itemAtRow:i];
+ if ([expandedRegisters containsObject:[[node representedObject] fullname]])
+ {
+ [registerView expandItem:node];
+ }
+ }
}
#pragma mark BSSourceView Delegate