From 5a9bea7f96adfb6b7d2a0035183a8bda7cfe7cfe Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 31 Oct 2010 12:09:03 -0400 Subject: [PATCH] Switch to using VariableNode in the interface. Reduce use of NSXMLElementAdditions to just the key methods. --- English.lproj/Debugger.xib | 1342 ++++++++++++++++++++++---------- Source/DebuggerController.h | 5 +- Source/DebuggerController.m | 18 +- Source/DebuggerProcessor.m | 19 +- Source/NSXMLElementAdditions.h | 6 +- Source/NSXMLElementAdditions.m | 68 +- Source/VariableNode.m | 54 +- 7 files changed, 995 insertions(+), 517 deletions(-) diff --git a/English.lproj/Debugger.xib b/English.lproj/Debugger.xib index c096631..10cf097 100644 --- a/English.lproj/Debugger.xib +++ b/English.lproj/Debugger.xib @@ -1,27 +1,27 @@ - + 1050 - 9J61 - 677 - 949.46 - 353.00 + 10F569 + 804 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 804 + YES - + + YES com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -39,7 +39,7 @@ 2 {{363, 277}, {769, 501}} 1886912512 - R0RCcCA8aG9zdD46PHBvcnQ+IEAgPHNlc3Npb24+A + GDBp <host>:<port> @ <session> NSWindow @@ -54,7 +54,7 @@ 1 YES - + YES 4F493FF4-D55D-4881-B16D-54ED9DC66FF7 87BEA2D0-EF8E-4DF2-9827-B2AC06858DC6 @@ -207,96 +207,9 @@ Customize Customize Toolbar - - 683671552 - {32, 32} - - YES - - YES - - - - TU0AKgAAEAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0BAAADAAAAAQAgAAABAQADAAAAAQAgAAABAgADAAAABAAA -EKoBAwADAAAAAQABAAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAE -AAABFgADAAAAAQD8AAABFwAEAAAAAQAAEAABHAADAAAAAQABAAABUgADAAAAAQABAAABUwADAAAABAAA -ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - - - - - - 3 - MCAwAA - + + NSImage + NSToolbarCustomizeToolbarItemImage runToolbarCustomizationPalette: @@ -427,7 +340,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} @@ -443,10 +356,10 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 67239424 272629760 - PGVycm9yPg + <error> LucidaGrande - 1.100000e+01 + 11 3100 @@ -456,7 +369,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ controlColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -474,10 +387,10 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 67239424 272629760 - PHN0YXR1cz4 + <status> LucidaGrande - 1.100000e+01 + 11 16 @@ -535,12 +448,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - 1.100000e+02 - 1.600000e+01 - 1.000000e+03 + 110 + 16 + 1000 - 75628032 - 0 + 75628096 + 2048 Variable @@ -573,12 +486,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 1.380000e+02 - 8.000000e+00 - 1.000000e+03 + 138 + 8 + 1000 - 75628032 - 0 + 75628096 + 2048 Value @@ -598,12 +511,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 1.197544e+02 - 2.975439e+01 - 1.000000e+03 + 119.7544 + 29.754390000000001 + 1000 - 67239424 - 0 + 75628096 + 2048 Type @@ -631,8 +544,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -643,12 +556,15 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ MC41AA - 1.400000e+01 + 14 1379958784 + + 1 15 0 YES + 0 {{1, 17}, {377, 205}} @@ -665,7 +581,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ _doScroller: - 8.170732e-01 + 0.81707320000000005 @@ -675,7 +591,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 1 _doScroller: - 3.449477e-01 + 0.34494770000000002 @@ -737,12 +653,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES index - 1.000000e+01 - 1.000000e+01 - 3.000000e+01 + 10 + 10 + 30 - 75628032 - 0 + 75628096 + 2048 # @@ -771,12 +687,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ filename - 1.120000e+02 - 8.000000e+00 - 1.000000e+03 + 112 + 8 + 1000 - 75628032 - 0 + 75628096 + 2048 File @@ -802,12 +718,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ lineNumber - 3.300000e+01 - 2.600000e+01 - 1.000000e+03 + 33 + 26 + 1000 - 67239424 - 0 + 75628096 + 2048 Line @@ -833,12 +749,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ function - 2.150000e+02 - 5.006250e+01 - 1.000000e+03 + 215 + 50.0625 + 1000 - 67239424 - 0 + 75628096 + 2048 Function @@ -863,16 +779,19 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.700000e+01 + 17 1388347392 + + 1 15 0 YES + 0 {{1, 17}, {382, 205}} @@ -889,7 +808,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ _doScroller: - 9.268293e-01 + 0.92682929999999997 @@ -899,7 +818,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 1 _doScroller: - 9.973890e-01 + 0.99738899999999997 @@ -950,7 +869,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{0, 0}, {1440, 878}} {213, 169} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} DebuggerWindow @@ -978,16 +897,16 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES value - variable - type - fullname + name + fullName + displayType - NSXMLElement + VariableNode YES YES YES - subnodes + dynamicChildren isLeaf @@ -998,9 +917,9 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ Inspector NSPanel - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} - + 256 YES @@ -1027,7 +946,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - + YES NSColor NSFont @@ -1041,7 +960,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ Monaco - 1.000000e+01 + 10 16 @@ -1049,100 +968,100 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - 0.000000e+00 + 0.0 - 5.600000e+01 + 56 - 1.120000e+02 + 112 - 1.680000e+02 + 168 - 2.240000e+02 + 224 - 2.800000e+02 + 280 - 3.360000e+02 + 336 - 3.920000e+02 + 392 - 4.480000e+02 + 448 - 5.040000e+02 + 504 - 5.600000e+02 + 560 - 6.160000e+02 + 616 - 6.720000e+02 + 672 - 7.280000e+02 + 728 - 7.840000e+02 + 784 - 8.400000e+02 + 840 - 8.960000e+02 + 896 - 9.520000e+02 + 952 - 1.008000e+03 + 1008 - 1.064000e+03 + 1064 - 1.120000e+03 + 1120 - 1.176000e+03 + 1176 - 1.232000e+03 + 1232 - 1.288000e+03 + 1288 - 1.344000e+03 + 1344 - 1.400000e+03 + 1400 - 1.456000e+03 + 1456 - 1.512000e+03 + 1512 - 1.568000e+03 + 1568 - 1.624000e+03 + 1624 - 1.680000e+03 + 1680 - 1.736000e+03 + 1736 @@ -1158,16 +1077,17 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 4.020000e+02 + 402 1 10849 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -1188,10 +1108,10 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - + YES - + YES NSColor NSUnderline @@ -1202,7 +1122,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 1 MCAwIDEAA - + @@ -1231,8 +1151,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ _doScroller: - 2.333333e-01 - 8.994975e-01 + 0.23333329999999999 + 0.89949749999999995 @@ -1242,8 +1162,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 1 _doScroller: - 8.670695e-01 - 9.456522e-01 + 0.86706950000000005 + 0.94565220000000005 {{-1, -1}, {402, 402}} @@ -1256,9 +1176,10 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {400, 400} + {{0, 0}, {1440, 878}} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} InspectorWindow @@ -1316,38 +1237,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 70 - - - value: arrangedObjects.variable - - - - - - value: arrangedObjects.variable - value - arrangedObjects.variable - 2 - - - 74 - - - - value: arrangedObjects.type - - - - - - value: arrangedObjects.type - value - arrangedObjects.type - 2 - - - 83 - delegate @@ -1457,7 +1346,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ arrangedObjects.index NSConditionallySetsEditable - + 2 @@ -1477,7 +1366,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ arrangedObjects.lineNumber NSConditionallySetsEditable - + 2 @@ -1497,7 +1386,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ arrangedObjects.function NSConditionallySetsEditable - + 2 @@ -1560,22 +1449,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 568 - - - title: selection.fullname - - - - - - title: selection.fullname - title - selection.fullname - 2 - - - 574 - value: selection.value @@ -1624,6 +1497,62 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 587 + + + value: arrangedObjects.name + + + + + + value: arrangedObjects.name + value + arrangedObjects.name + + NSConditionallySetsEditable + + + 2 + + + 588 + + + + title: selection.fullName + + + + + + title: selection.fullName + title + selection.fullName + 2 + + + 589 + + + + value: arrangedObjects.displayType + + + + + + value: arrangedObjects.displayType + value + arrangedObjects.displayType + + NSConditionallySetsEditable + + + 2 + + + 590 + @@ -1640,7 +1569,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ -2 - RmlsZSdzIE93bmVyA + File's Owner -1 @@ -2038,10 +1967,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 11.IBPluginDependency @@ -2113,6 +2040,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 502.CustomClassName 502.IBPluginDependency 569.IBEditorWindowLastContentRect + 569.IBPluginDependency 569.IBWindowTemplateEditedContentRect 569.NSWindowTemplate.visibleAtLaunch 570.IBPluginDependency @@ -2125,6 +2053,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 59.IBPluginDependency 59.ImportedFromIB2 7.IBEditorWindowLastContentRect + 7.IBPluginDependency 7.IBViewEditorWindowController.showingBoundsRectangles 7.IBViewEditorWindowController.showingLayoutRectangles 7.IBWindowTemplateEditedContentRect @@ -2143,69 +2072,67 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - + BSSplitView com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + {{445, 738}, {617, 0}} com.apple.InterfaceBuilder.CocoaPlugin {{418, 770}, {617, 0}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2214,8 +2141,9 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ com.apple.InterfaceBuilder.CocoaPlugin BSSplitView com.apple.InterfaceBuilder.CocoaPlugin - {{478, 327}, {331, 423}} - {{478, 327}, {331, 423}} + {{478, 327}, {400, 400}} + com.apple.InterfaceBuilder.CocoaPlugin + {{478, 327}, {400, 400}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2225,29 +2153,28 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + {{369, 237}, {769, 501}} - - + com.apple.InterfaceBuilder.CocoaPlugin + + {{369, 237}, {769, 501}} - - + + {{344, 269}, {769, 501}} - - + + {3.40282e+38, 3.40282e+38} {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + YES - - YES - + YES @@ -2255,59 +2182,17 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - - YES - + YES - 587 + 590 YES - - AppDelegate - NSObject - - YES - - YES - openHelpPage: - showBreakpointWindow: - showDebuggerWindow: - showInspectorWindow: - showPreferences: - - - YES - id - id - id - id - id - - - - YES - - YES - breakpoint - debugger - - - YES - BreakpointController - DebuggerController - - - - IBProjectSource - Source/AppDelegate.h - - BSSourceView NSView @@ -2315,6 +2200,13 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ delegate id + + delegate + + delegate + id + + IBProjectSource Source/BSSourceView.h @@ -2337,64 +2229,71 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - BreakpointController + DebuggerController NSWindowController YES - + YES - addBreakpoint: - removeBreakpoint: + reconnect: + run: + showInspectorWindow: + stepIn: + stepOut: + stepOver: YES id id + id + id + id + id - - YES - - YES - arrayController - sourceView - - - YES - NSArrayController - BSSourceView - - - - IBProjectSource - Source/BreakpointController.h - - - - DebuggerController - NSWindowController - + YES - + YES reconnect: run: + showInspectorWindow: stepIn: stepOut: stepOver: YES - id - id - id - id - id + + reconnect: + id + + + run: + id + + + showInspectorWindow: + id + + + stepIn: + id + + + stepOut: + id + + + stepOver: + id + YES - + YES errormsg inspector @@ -2415,6 +2314,50 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ NSTreeController + + YES + + YES + errormsg + inspector + sourceViewer + stackArrayController + statusmsg + variablesOutlineView + variablesTreeController + + + YES + + errormsg + NSTextField + + + inspector + NSWindow + + + sourceViewer + BSSourceView + + + stackArrayController + NSArrayController + + + statusmsg + NSTextField + + + variablesOutlineView + NSOutlineView + + + variablesTreeController + NSTreeController + + + IBProjectSource Source/DebuggerController.h @@ -2443,21 +2386,632 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ NSObject - IBProjectSource - Source/SocketWrapper.h + IBUserSource + + + + YES - NSObject + NSActionCell + NSCell - IBUserSource - + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h - - - 0 - ../MacGDBp.xcodeproj - 3 + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../MacGDBp.xcodeproj + 3 + + YES + + YES + HUDIcon.png + NSMenuCheckmark + NSMenuMixedState + NSToolbarCustomizeToolbarItemImage + Reconnect.png + Run.png + StepIn.png + StepOut.png + StepOver.png + + + YES + {128, 128} + {9, 8} + {7, 2} + {32, 32} + {128, 128} + {128, 128} + {128, 128} + {128, 128} + {128, 128} + + diff --git a/Source/DebuggerController.h b/Source/DebuggerController.h index d356ad9..aaaf7d7 100644 --- a/Source/DebuggerController.h +++ b/Source/DebuggerController.h @@ -18,6 +18,7 @@ #import "BSSourceView.h" #import "DebuggerProcessor.h" #import "StackController.h" +#include "VariableNode.h" @interface DebuggerController : NSWindowController { @@ -37,7 +38,7 @@ IBOutlet NSTreeController* variablesTreeController; IBOutlet NSOutlineView* variablesOutlineView; NSMutableSet* expandedVariables; - NSXMLElement* selectedVariable; + VariableNode* selectedVariable; IBOutlet NSWindow* inspector; @@ -65,6 +66,6 @@ - (IBAction)stepOver:(id)sender; - (IBAction)reconnect:(id)sender; -- (void)fetchProperty:(NSString*)property forNode:(NSXMLElement*)node; +- (void)fetchProperty:(NSString*)property forNode:(VariableNode*)node; @end diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index 579084e..8ae3e2f 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -214,7 +214,7 @@ [connection stepOver]; } -- (void)fetchProperty:(NSString*)property forNode:(NSXMLElement*)node +- (void)fetchProperty:(NSString*)property forNode:(VariableNode*)node { NSInteger txn = [connection getProperty:property]; [pendingProperties_ setObject:node forKey:[NSNumber numberWithInt:txn]]; @@ -236,7 +236,7 @@ - (void)outlineViewItemDidExpand:(NSNotification*)notif { NSTreeNode* node = [[notif userInfo] objectForKey:@"NSObject"]; - [expandedVariables addObject:[[node representedObject] fullname]]; + [expandedVariables addObject:[[node representedObject] fullName]]; } /** @@ -244,7 +244,7 @@ */ - (void)outlineViewItemDidCollapse:(NSNotification*)notif { - [expandedVariables removeObject:[[[[notif userInfo] objectForKey:@"NSObject"] representedObject] fullname]]; + [expandedVariables removeObject:[[[[notif userInfo] objectForKey:@"NSObject"] representedObject] fullName]]; } #pragma mark Private @@ -301,19 +301,19 @@ */ - (void)expandVariables { - NSString* selection = [selectedVariable fullname]; + NSString* selection = [selectedVariable fullName]; for (int i = 0; i < [variablesOutlineView numberOfRows]; i++) { NSTreeNode* node = [variablesOutlineView itemAtRow:i]; - NSString* fullname = [[node representedObject] fullname]; + NSString* fullName = [[node representedObject] fullName]; // see if it needs expanding - if ([expandedVariables containsObject:fullname]) + if ([expandedVariables containsObject:fullName]) [variablesOutlineView expandItem:node]; // select it if we had it selected before - if ([fullname isEqualToString:selection]) + if ([fullName isEqualToString:selection]) [variablesTreeController setSelectionIndexPath:[node indexPath]]; } } @@ -370,9 +370,9 @@ - (void)receivedProperties:(NSArray*)properties forTransaction:(NSInteger)transaction { NSNumber* key = [NSNumber numberWithInt:transaction]; - NSXMLElement* node = [pendingProperties_ objectForKey:key]; + VariableNode* node = [pendingProperties_ objectForKey:key]; if (node) { - [node setChildren:properties]; + [node setChildrenFromXMLChildren:properties]; [variablesTreeController rearrangeObjects]; [pendingProperties_ removeObjectForKey:key]; } diff --git a/Source/DebuggerProcessor.m b/Source/DebuggerProcessor.m index e8125e9..cad456a 100644 --- a/Source/DebuggerProcessor.m +++ b/Source/DebuggerProcessor.m @@ -17,6 +17,7 @@ #import "DebuggerProcessor.h" #import "AppDelegate.h" +#import "NSXMLElementAdditions.h" // GDBpConnection (Private) //////////////////////////////////////////////////// @@ -365,7 +366,7 @@ if (!frame) return; - frame.source = [[response rootElement] value]; + frame.source = [[response rootElement] base64DecodedValue]; if ([delegate respondsToSelector:@selector(sourceUpdated:)]) [delegate sourceUpdated:frame]; @@ -416,18 +417,22 @@ // Get the stack frame by the |routingID|. StackFrame* frame = [stackFrames_ objectForKey:routingID]; - + NSMutableArray* variables = [NSMutableArray array]; - + // Merge the frame's existing variables. if (frame.variables) [variables addObjectsFromArray:frame.variables]; - + // Add these new variables. NSArray* addVariables = [[response rootElement] children]; - if (addVariables) - [variables addObjectsFromArray:addVariables]; - + if (addVariables) { + for (NSXMLElement* elm in addVariables) { + VariableNode* node = [[VariableNode alloc] initWithXMLNode:elm]; + [variables addObject:[node autorelease]]; + } + } + frame.variables = variables; } diff --git a/Source/NSXMLElementAdditions.h b/Source/NSXMLElementAdditions.h index dd54160..fe6ac81 100644 --- a/Source/NSXMLElementAdditions.h +++ b/Source/NSXMLElementAdditions.h @@ -18,11 +18,7 @@ @interface NSXMLElement (GDBpAdditions) -- (NSString*)fullname; -- (NSString*)variable; - (BOOL)isLeaf; -- (NSString*)value; -- (NSString*)type; -- (NSArray*)subnodes; +- (NSString*)base64DecodedValue; @end diff --git a/Source/NSXMLElementAdditions.m b/Source/NSXMLElementAdditions.m index d86d03c..079951c 100644 --- a/Source/NSXMLElementAdditions.m +++ b/Source/NSXMLElementAdditions.m @@ -15,27 +15,12 @@ */ #import -#include "base64.h" + #import "AppDelegate.h" +#include "base64.h" @implementation NSXMLElement (GDBpAdditions) -/** - * Return's the property's full name - */ -- (NSString*)fullname -{ - return [[self attributeForName:@"fullname"] stringValue]; -} - -/** - * Return's the property's name from the attributes list - */ -- (NSString*)variable -{ - return [[self attributeForName:@"name"] stringValue]; -} - /** * Returns whether or not this node has any children */ @@ -44,34 +29,20 @@ return ([[[self attributeForName:@"children"] stringValue] intValue] == 0); } -/** - * Override children so we can fetch more depth as needed - */ -- (NSArray*)subnodes -{ - NSArray* children = [self children]; - 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]; - } - return children; -} - /** * Returns the value of the property */ -- (NSString*)value +- (NSString*)base64DecodedValue { - // not a leaf, so don't display any value - if (![self isLeaf]) - { + // Non-leaf nodes do not have a value: + // https://www.bluestatic.org/bugs/showreport.php?bugid=168 + if (![self isLeaf]) { return @"..."; } - // base64 encoded data - if ([[[self attributeForName:@"encoding"] stringValue] isEqualToString:@"base64"]) - { + // The value of the node is base64 encoded. + NSLog(@"encoding check"); + if ([[[self attributeForName:@"encoding"] stringValue] isEqualToString:@"base64"]) { const char* str = [[self stringValue] UTF8String]; int strlen = [[self stringValue] length]; @@ -82,8 +53,7 @@ NSLog(@"error in converting %@ from base64", self); NSString* ret = nil; - if (data) - { + if (data) { ret = [NSString stringWithUTF8String:data]; free(data); } @@ -91,22 +61,8 @@ return ret; } - // just a normal string - return [self stringValue]; -} - -/** - * Returns the type of variable this is - */ -- (NSString*)type -{ - NSXMLNode* className = [self attributeForName:@"classname"]; - NSString* type = [[self attributeForName:@"type"] stringValue]; - if (className != nil) - { - return [NSString stringWithFormat:@"%@ (%@)", [className stringValue], type]; - } - return type; + // The value is just a normal string. + return [self stringValue]; } @end diff --git a/Source/VariableNode.m b/Source/VariableNode.m index 23ac627..1fdcb58 100644 --- a/Source/VariableNode.m +++ b/Source/VariableNode.m @@ -17,7 +17,7 @@ #import "VariableNode.h" #import "AppDelegate.h" -#include "base64.h" +#include "NSXMLElementAdditions.h" // Private Properties ////////////////////////////////////////////////////////// @@ -30,9 +30,6 @@ @property (copy) NSString* value; @property (retain) NSMutableArray* children; -// Takes an XML node and computes the value. -- (NSString*)decodeValueForNode:(NSXMLElement*)node; - @end //////////////////////////////////////////////////////////////////////////////// @@ -51,10 +48,10 @@ { if (self = [super init]) { self.name = [[node attributeForName:@"name"] stringValue]; - self.fullName = [[node attributeForName:@"fullName"] stringValue]; - self.className = [[node attributeForName:@"className"] stringValue]; + self.fullName = [[node attributeForName:@"fullname"] stringValue]; + self.className = [[node attributeForName:@"classname"] stringValue]; self.type = [[node attributeForName:@"type"] stringValue]; - self.value = [self decodeValueForNode:node]; + self.value = [node base64DecodedValue]; self.children = [NSMutableArray array]; if ([node children]) { [self setChildrenFromXMLChildren:[node children]]; @@ -77,9 +74,12 @@ - (void)setChildrenFromXMLChildren:(NSArray*)children { - for (NSXMLElement* child in children) { - VariableNode* node = [[VariableNode alloc] initWithXMLNode:child]; - [children_ addObject:[node autorelease]]; + for (NSXMLNode* child in children) { + // Other child nodes may be the string value. + if ([child isKindOfClass:[NSXMLElement class]]) { + VariableNode* node = [[VariableNode alloc] initWithXMLNode:(NSXMLElement*)child]; + [children_ addObject:[node autorelease]]; + } } } @@ -107,38 +107,4 @@ return self.type; } -// Private ///////////////////////////////////////////////////////////////////// - -- (NSString*)decodeValueForNode:(NSXMLElement*)node -{ - // Non-leaf nodes do not have a value: - // https://www.bluestatic.org/bugs/showreport.php?bugid=168 - if (![self isLeaf]) { - return @"..."; - } - - // The value of the node is base64 encoded. - if ([[[node attributeForName:@"encoding"] stringValue] isEqualToString:@"base64"]) { - const char* str = [[node stringValue] UTF8String]; - int strlen = [[node stringValue] length]; - - char* data; - size_t datalen; - - if (!base64_decode_alloc(str, strlen, &data, &datalen)) - NSLog(@"error in converting %@ from base64", self); - - NSString* ret = nil; - if (data) { - ret = [NSString stringWithUTF8String:data]; - free(data); - } - - return ret; - } - - // The value is just a normal string. - return [node stringValue]; -} - @end -- 2.43.5