- (IBAction)stepOver:(id)sender;
- (IBAction)reconnect:(id)sender;
-- (void)fetchProperty:(NSString*)property forNode:(VariableNode*)node;
+- (void)fetchChildProperties:(VariableNode*)node;
@end
[connection stepOver];
}
-- (void)fetchProperty:(NSString*)property forNode:(VariableNode*)node
+- (void)fetchChildProperties:(VariableNode*)node
{
- NSInteger txn = [connection getProperty:property];
+ NSArray* selection = [stackArrayController selectedObjects];
+ assert([selection count] == 1);
+ NSInteger depth = [[selection objectAtIndex:0] index];
+ NSInteger txn = [connection getChildrenOfProperty:node atDepth:depth];
[pendingProperties_ setObject:node forKey:[NSNumber numberWithInt:txn]];
}
#import "StackFrame.h"
@protocol DebuggerProcessorDelegate;
+@class VariableNode;
// The DebuggerProcessor is the communication layer between the application
// and the back-end debugger. Clients issue debugger commands via this class,
- (void)removeBreakpoint:(Breakpoint*)bp;
// Gets a property by name from the debugger engine. Returns a transaction ID
-// which used in the delegate callback.
-- (NSInteger)getProperty:(NSString*)property;
+// which used in the delegate callback. Properties must be retrieved at a
+// certain stack depth.
+- (NSInteger)getChildrenOfProperty:(VariableNode*)property atDepth:(NSInteger)depth;
// Takes a partially loaded stack frame and fetches the rest of the information.
- (void)loadStackFrame:(StackFrame*)frame;
* Tells the debugger engine to get a specifc property. This also takes in the NSXMLElement
* that requested it so that the child can be attached.
*/
-- (NSInteger)getProperty:(NSString*)property
+- (NSInteger)getChildrenOfProperty:(VariableNode*)property atDepth:(NSInteger)depth;
{
- NSNumber* tx = [connection_ sendCommandWithFormat:@"property_get -n \"%@\"", property];
+ NSNumber* tx = [connection_ sendCommandWithFormat:@"property_get -d %d -n %@", depth, [property fullName]];
[self recordCallback:@selector(propertiesReceived:) forTransaction:tx];
return [tx intValue];
}
NSString* value_;
NSMutableArray* children_;
NSInteger childCount_;
+ NSString* address_;
}
@property (readonly, copy) NSString* name;
@property (readonly, copy) NSString* value;
@property (readonly, retain) NSArray* children;
@property (readonly) NSInteger childCount;
+@property (readonly, copy) NSString* address;
// Creates and initializes a new VariableNode from the XML response from the
// debugger backend.
@property (copy) NSString* type;
@property (copy) NSString* value;
@property (retain) NSMutableArray* children;
+@property (copy) NSString* address;
@end
@synthesize value = value_;
@synthesize children = children_;
@synthesize childCount = childCount_;
+@synthesize address = address_;
- (id)initWithXMLNode:(NSXMLElement*)node
{
[self setChildrenFromXMLChildren:[node children]];
}
childCount_ = [[[node attributeForName:@"numchildren"] stringValue] integerValue];
+ self.address = [[node attributeForName:@"address"] stringValue];
}
return self;
}
self.type = nil;
self.value = nil;
self.children = nil;
+ self.address = nil;
[super dealloc];
}
if (![self isLeaf] && [children count] < 1) {
// If this node has children but they haven't been loaded from the backend,
// request them asynchronously.
- [[AppDelegate instance].debugger fetchProperty:self.fullName forNode:self];
+ [[AppDelegate instance].debugger fetchChildProperties:self];
}
return children;
}