Show the variables in all contexts instead of just Locals. Fixes #147.
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 5 Feb 2009 18:43:12 +0000 (13:43 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 5 Feb 2009 18:43:12 +0000 (13:43 -0500)
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
English.lproj/Debugger.xib
Source/GDBpConnection.m
Source/StackFrame.h
Source/StackFrame.m

diff --git a/CHANGES b/CHANGES
index ed40916620573169b837db8c5a234da726a9bcbd..a48853acb05401a423579caed08e7006329fda3e 100644 (file)
--- 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
index 1a8ef2cd396e44a2f3c3ff53d50d32f2f9933c1e..bbf9ce37563c1bca0b8e33751ace8a2ba03978ab 100644 (file)
@@ -2,13 +2,13 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
        <data>
                <int key="IBDocument.SystemTarget">1050</int>
-               <string key="IBDocument.SystemVersion">9F33</string>
+               <string key="IBDocument.SystemVersion">9G55</string>
                <string key="IBDocument.InterfaceBuilderVersion">672</string>
-               <string key="IBDocument.AppKitVersion">949.34</string>
-               <string key="IBDocument.HIToolboxVersion">352.00</string>
+               <string key="IBDocument.AppKitVersion">949.43</string>
+               <string key="IBDocument.HIToolboxVersion">353.00</string>
                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="460"/>
+                       <integer value="14"/>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
@@ -925,6 +925,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
                                        <string>lineNumber</string>
                                        <string>function</string>
                                        <string>contexts.Locals</string>
+                                       <string>variables</string>
                                </object>
                                <string key="NSObjectClassName">StackFrame</string>
                                <bool key="NSEditable">YES</bool>
@@ -1232,22 +1233,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
                                        </object>
                                        <int key="connectionID">564</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBBindingConnection" key="connection">
-                                               <string key="label">contentArray: selection.contexts.Locals</string>
-                                               <reference key="source" ref="240336030"/>
-                                               <reference key="destination" ref="988542050"/>
-                                               <object class="NSNibBindingConnector" key="connector">
-                                                       <reference key="NSSource" ref="240336030"/>
-                                                       <reference key="NSDestination" ref="988542050"/>
-                                                       <string key="NSLabel">contentArray: selection.contexts.Locals</string>
-                                                       <string key="NSBinding">contentArray</string>
-                                                       <string key="NSKeyPath">selection.contexts.Locals</string>
-                                                       <int key="NSNibBindingConnectorVersion">2</int>
-                                               </object>
-                                       </object>
-                                       <int key="connectionID">565</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">variablesTreeController</string>
@@ -1264,6 +1249,22 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
                                        </object>
                                        <int key="connectionID">567</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">contentArray: selection.variables</string>
+                                               <reference key="source" ref="240336030"/>
+                                               <reference key="destination" ref="988542050"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="240336030"/>
+                                                       <reference key="NSDestination" ref="988542050"/>
+                                                       <string key="NSLabel">contentArray: selection.variables</string>
+                                                       <string key="NSBinding">contentArray</string>
+                                                       <string key="NSKeyPath">selection.variables</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">568</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
@@ -1803,7 +1804,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">567</int>
+                       <int key="maxID">568</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
index 4d32f8aacc210a8b6c6e908ac320db25bd90fc1b..6564ccd148137438ebef48148118f8b378f8d241 100644 (file)
@@ -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];
index 332699a946221be4d9efe53cc92881a39b142091..b80e0082c98680b9e28cfa229b40dc1877e7e34d 100644 (file)
@@ -45,9 +45,9 @@
        NSString *function;
        
        /**
-        * Variable contexts (e.g. locals, class, etc.)
+        * Variable list
         */
-       NSDictionary *contexts;
+       NSArray *variables;
 }
 
 @property(readwrite) int index;
 @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;
 
index 1a1e06cba3159c54aab7db09aa1f26e84a17b919..0a955db9fe25f61020d92c605734c19969a78469 100644 (file)
 @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;
 }