From 0228bbeee4a7a182384de5433f3c7b0b09ab8d42 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 5 Feb 2009 13:43:12 -0500 Subject: [PATCH] Show the variables in all contexts instead of just Locals. Fixes #147. Patch partial from Nicola Ferruzzi. * Source/StackFrame.m+h: Change "contexts" to "variables" (initWithIndex:withFilename:withSource:atLine:inFunction:withContexts:): Renamed to be ...withVariables: * Source/GDBpConnection.m: (createStackFrame): Collect all the contexts into an array and send that to StackFrame * English.lproj/Debugger.xib: Rebind to simply "variables" --- CHANGES | 2 ++ English.lproj/Debugger.xib | 43 +++++++++++++++++++------------------- Source/GDBpConnection.m | 10 ++++----- Source/StackFrame.h | 8 +++---- Source/StackFrame.m | 8 +++---- 5 files changed, 37 insertions(+), 34 deletions(-) diff --git a/CHANGES b/CHANGES index ed40916..a48853a 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ MacGDBp CHANGE LOG value, allowing you to see the last part of the path URI - Fix: #129 Debugging files on a remote server will now work if the remote path does not exist on the local debugging client - Change: The debugger will automatically step in to the first frame when the connection is made +- New: #147 Show super globals (and variables in other contexts) in the +variable viewer 1.1.2 diff --git a/English.lproj/Debugger.xib b/English.lproj/Debugger.xib index 1a8ef2c..bbf9ce3 100644 --- a/English.lproj/Debugger.xib +++ b/English.lproj/Debugger.xib @@ -2,13 +2,13 @@ 1050 - 9F33 + 9G55 672 - 949.34 - 352.00 + 949.43 + 353.00 YES - + YES @@ -925,6 +925,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ lineNumber function contexts.Locals + variables StackFrame YES @@ -1232,22 +1233,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 564 - - - contentArray: selection.contexts.Locals - - - - - - contentArray: selection.contexts.Locals - contentArray - selection.contexts.Locals - 2 - - - 565 - variablesTreeController @@ -1264,6 +1249,22 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 567 + + + contentArray: selection.variables + + + + + + contentArray: selection.variables + contentArray + selection.variables + 2 + + + 568 + @@ -1803,7 +1804,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 567 + 568 diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index 4d32f8a..6564ccd 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -306,7 +306,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; // get the names of all the contexts [socket send:[self createCommand:@"context_names -d 0"]]; NSXMLElement *contextNames = [[self processData:[socket receive]] rootElement]; - NSMutableDictionary *contexts = [NSMutableDictionary dictionary]; + NSMutableArray *variables = [NSMutableArray array]; for (NSXMLElement *context in [contextNames children]) { NSString *name = [[context attributeForName:@"name"] stringValue]; @@ -314,9 +314,9 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; // fetch the contexts [socket send:[self createCommand:[NSString stringWithFormat:@"context_get -d 0 -c %d", cid]]]; - NSArray *variables = [[[self processData:[socket receive]] rootElement] children]; - if (variables != nil && name != nil) - [contexts setObject:variables forKey:name]; + NSArray *addVars = [[[self processData:[socket receive]] rootElement] children]; + if (addVars != nil && name != nil) + [variables addObjectsFromArray:addVars]; } // get the source @@ -331,7 +331,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; withSource:source atLine:[[[xmlframe attributeForName:@"lineno"] stringValue] intValue] inFunction:[[xmlframe attributeForName:@"where"] stringValue] - withContexts:contexts + withVariables:variables ]; return [frame autorelease]; diff --git a/Source/StackFrame.h b/Source/StackFrame.h index 332699a..b80e008 100644 --- a/Source/StackFrame.h +++ b/Source/StackFrame.h @@ -45,9 +45,9 @@ NSString *function; /** - * Variable contexts (e.g. locals, class, etc.) + * Variable list */ - NSDictionary *contexts; + NSArray *variables; } @property(readwrite) int index; @@ -55,14 +55,14 @@ @property(readonly, copy) NSString *source; @property(readwrite) int lineNumber; @property(readwrite, copy) NSString *function; -@property(readonly, copy) NSDictionary *contexts; +@property(readonly, copy) NSArray *variables; - (id)initWithIndex:(int)anIndex withFilename:(NSString *)aFilename withSource:(NSString *)aSource atLine:(int)aLineNumber inFunction:(NSString *)function - withContexts:(NSDictionary *)contexts; + withVariables:(NSArray *)variables; - (BOOL)isShiftedFrame:(StackFrame *)frame; diff --git a/Source/StackFrame.m b/Source/StackFrame.m index 1a1e06c..0a955db 100644 --- a/Source/StackFrame.m +++ b/Source/StackFrame.m @@ -22,13 +22,13 @@ @interface StackFrame() @property(readwrite, copy) NSString *filename; @property(readwrite, copy) NSString *source; -@property(readwrite, copy) NSDictionary *contexts; +@property(readwrite, copy) NSArray *variables; @end /***/ @implementation StackFrame -@synthesize index, filename, source, lineNumber, function, contexts; +@synthesize index, filename, source, lineNumber, function, variables; /** * Constructor @@ -38,7 +38,7 @@ withSource:(NSString *)aSource atLine:(int)aLineNumber inFunction:(NSString *)aFunction - withContexts:(NSDictionary *)aContexts + withVariables:(NSArray *)aVariables { if (self = [super init]) { @@ -47,7 +47,7 @@ self.source = aSource; self.lineNumber = aLineNumber; self.function = aFunction; - self.contexts = aContexts; + self.variables = aVariables; } return self; } -- 2.43.5