Add a "stop" button to the toolbar that detaches the debugger from the backend for...
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 5 Jan 2011 23:42:05 +0000 (18:42 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 5 Jan 2011 23:42:11 +0000 (18:42 -0500)
CHANGES
English.lproj/Debugger.xib
Icons/Stop.png [new file with mode: 0644]
MacGDBp.xcodeproj/project.pbxproj
Source/DebuggerBackEnd.h
Source/DebuggerBackEnd.m
Source/DebuggerController.h
Source/DebuggerController.m
dev/Resource Masters/Toolbar Buttons.psd

diff --git a/CHANGES b/CHANGES
index e93b6a6b79cf621b5ae504cc414c4465dee5bbad..bafb23902dc5c1d179bd56f08f7e69bf91f24417 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,7 @@ highlighted.
 - New: #165  "Reconnect" is now removed and instead the debugger is either attached or detached.
 - Change: MacGDBp should no longer become unresponsive while waiting for Xdebug data
 - Change: MacGDBp should no longer corrupt text data returned from Xdebug
+- New: #210  Add a "Stop" button to detach the debugger from the current session
 
 
 1.3
index 92b0e4776cc13ccdd770891bcd5a922139d437d1..151c1034579f3bd40b950253e1470aa34f3352a2 100644 (file)
@@ -12,7 +12,7 @@
                </object>
                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="592"/>
+                       <integer value="7"/>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,6 +56,7 @@
                                                <object class="NSArray" key="dict.sortedKeys">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>0DD9463E-4676-43E6-B885-7A9CB1137956</string>
+                                                       <string>16B58F9D-A05F-41F5-BD7C-37FD7619A84A</string>
                                                        <string>4F493FF4-D55D-4881-B16D-54ED9DC66FF7</string>
                                                        <string>87BEA2D0-EF8E-4DF2-9827-B2AC06858DC6</string>
                                                        <string>91C3B0BD-0D34-4A26-A0EA-CC2A093F5916</string>
@@ -80,6 +81,7 @@
                                                                        <int key="NSvFlags">268</int>
                                                                        <string key="NSFrame">{{0, 14}, {83, 18}}</string>
                                                                        <reference key="NSSuperview"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <bool key="NSEnabled">YES</bool>
                                                                        <object class="NSButtonCell" key="NSCell" id="660002690">
                                                                                <int key="NSCellFlags">-2080244224</int>
                                                                <bool key="NSToolbarIsUserRemovable">YES</bool>
                                                                <int key="NSToolbarItemVisibilityPriority">0</int>
                                                        </object>
+                                                       <object class="NSToolbarItem" id="341963234">
+                                                               <object class="NSMutableString" key="NSToolbarItemIdentifier">
+                                                                       <characters key="NS.bytes">16B58F9D-A05F-41F5-BD7C-37FD7619A84A</characters>
+                                                               </object>
+                                                               <string key="NSToolbarItemLabel">Stop</string>
+                                                               <string key="NSToolbarItemPaletteLabel">Stop</string>
+                                                               <string key="NSToolbarItemToolTip"/>
+                                                               <nil key="NSToolbarItemView"/>
+                                                               <object class="NSCustomResource" key="NSToolbarItemImage">
+                                                                       <string key="NSClassName">NSImage</string>
+                                                                       <string key="NSResourceName">Stop</string>
+                                                               </object>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{0, 0}</string>
+                                                               <string key="NSToolbarItemMaxSize">{0, 0}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">-1</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                       </object>
                                                        <object class="NSToolbarItem" id="121644564">
                                                                <object class="NSMutableString" key="NSToolbarItemIdentifier">
                                                                        <characters key="NS.bytes">4F493FF4-D55D-4881-B16D-54ED9DC66FF7</characters>
                                                <reference ref="121644564"/>
                                                <reference ref="822794044"/>
                                                <reference ref="578309120"/>
+                                               <reference ref="341963234"/>
                                                <reference ref="909415165"/>
                                                <reference ref="619392803"/>
                                                <reference ref="1015206233"/>
                                                <reference ref="822794044"/>
                                                <reference ref="619392803"/>
                                                <reference ref="578309120"/>
+                                               <reference ref="341963234"/>
                                                <reference ref="1015206233"/>
                                                <reference ref="1015206233"/>
                                                <reference ref="909415165"/>
                                <string key="NSFrameAutosaveName">InspectorWindow</string>
                        </object>
                        <object class="NSUserDefaultsController" id="463528398">
-                               <object class="NSMutableArray" key="NSDeclaredKeys">
-                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                       <string>DebuggerAttached</string>
-                               </object>
                                <bool key="NSSharedInstance">YES</bool>
                        </object>
                </object>
                                        </object>
                                        <int key="connectionID">596</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">stop:</string>
+                                               <reference key="source" ref="78922448"/>
+                                               <reference key="destination" ref="341963234"/>
+                                       </object>
+                                       <int key="connectionID">598</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                        <reference ref="909415165"/>
                                                        <reference ref="53808834"/>
                                                        <reference ref="578309120"/>
+                                                       <reference ref="341963234"/>
                                                </object>
                                                <reference key="parent" ref="797274304"/>
                                        </object>
                                                <reference key="object" ref="578309120"/>
                                                <reference key="parent" ref="1070952276"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">597</int>
+                                               <reference key="object" ref="341963234"/>
+                                               <reference key="parent" ref="1070952276"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>59.ImportedFromIB2</string>
                                        <string>591.IBPluginDependency</string>
                                        <string>592.IBPluginDependency</string>
+                                       <string>597.IBPluginDependency</string>
                                        <string>7.IBEditorWindowLastContentRect</string>
                                        <string>7.IBPluginDependency</string>
                                        <string>7.IBViewEditorWindowController.showingBoundsRectangles</string>
                                        <integer value="1"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <integer value="1"/>
-                                       <string>{{444, 325}, {617, 227}}</string>
+                                       <string>{{442, 816}, {617, 0}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>{{418, 770}, {617, 0}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <integer value="1"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>{{368, 51}, {769, 501}}</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>{{366, 315}, {769, 501}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <integer value="0"/>
                                        <integer value="0"/>
-                                       <string>{{368, 51}, {769, 501}}</string>
+                                       <string>{{366, 315}, {769, 501}}</string>
                                        <integer value="1"/>
                                        <integer value="1"/>
                                        <string>{{344, 269}, {769, 501}}</string>
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">596</int>
+                       <int key="maxID">598</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                                        <string>stepIn:</string>
                                                        <string>stepOut:</string>
                                                        <string>stepOver:</string>
+                                                       <string>stop:</string>
                                                </object>
                                                <object class="NSMutableArray" key="dict.values">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>id</string>
                                                        <string>id</string>
                                                        <string>id</string>
+                                                       <string>id</string>
                                                </object>
                                        </object>
                                        <object class="NSMutableDictionary" key="actionInfosByName">
                                                        <string>stepIn:</string>
                                                        <string>stepOut:</string>
                                                        <string>stepOver:</string>
+                                                       <string>stop:</string>
                                                </object>
                                                <object class="NSMutableArray" key="dict.values">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                <string key="name">stepOver:</string>
                                                                <string key="candidateClassName">id</string>
                                                        </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">stop:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
                                                </object>
                                        </object>
                                        <object class="NSMutableDictionary" key="outlets">
                                <string>StepIn.png</string>
                                <string>StepOut.png</string>
                                <string>StepOver.png</string>
+                               <string>Stop</string>
                        </object>
                        <object class="NSMutableArray" key="dict.values">
                                <bool key="EncodedWithXMLCoder">YES</bool>
                                <string>{128, 128}</string>
                                <string>{128, 128}</string>
                                <string>{128, 128}</string>
+                               <string>{256, 256}</string>
                        </object>
                </object>
        </data>
diff --git a/Icons/Stop.png b/Icons/Stop.png
new file mode 100644 (file)
index 0000000..2ea0006
Binary files /dev/null and b/Icons/Stop.png differ
index 3b8509d678bce8f655283309094ec13e98eda7d9..cc5bd058308fdee50e3928c2898f465039b490f8 100644 (file)
@@ -14,6 +14,7 @@
                1E02C5F60C610724006F1752 /* DebuggerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E02C5F50C610724006F1752 /* DebuggerController.m */; };
                1E0AFBB90FC2518700C67031 /* HUDIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E0AFBB80FC2518700C67031 /* HUDIcon.png */; };
                1E1E53030DF9B89800D334F9 /* Breakpoints.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E1E53010DF9B89800D334F9 /* Breakpoints.xib */; };
+               1E2F0A6912D5371C00EBF675 /* Stop.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E2F0A6812D5371B00EBF675 /* Stop.png */; };
                1E35FC760C6579CA0030F527 /* NSXMLElementAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */; };
                1E416FF90D36F821009A53A2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E416FF60D36F821009A53A2 /* MainMenu.xib */; };
                1E42F1D70F53317B008412DB /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 1E42F1D60F53317B008412DB /* dsa_pub.pem */; };
@@ -78,6 +79,7 @@
                1E0724E111B47BCC0017AD3C /* NetworkConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkConnection.h; path = Source/NetworkConnection.h; sourceTree = "<group>"; };
                1E0AFBB80FC2518700C67031 /* HUDIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HUDIcon.png; path = Icons/HUDIcon.png; sourceTree = "<group>"; };
                1E1E53020DF9B89800D334F9 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Breakpoints.xib; sourceTree = "<group>"; };
+               1E2F0A6812D5371B00EBF675 /* Stop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Stop.png; path = Icons/Stop.png; sourceTree = "<group>"; };
                1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSXMLElementAdditions.m; path = Source/NSXMLElementAdditions.m; sourceTree = "<group>"; };
                1E35FFB00C65A74C0030F527 /* NSXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSXMLElementAdditions.h; path = Source/NSXMLElementAdditions.h; sourceTree = "<group>"; };
                1E416FF70D36F821009A53A2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
                1E027F0D0D36F24200885DEE /* Toolbar Icons */ = {
                        isa = PBXGroup;
                        children = (
+                               1E2F0A6812D5371B00EBF675 /* Stop.png */,
                                1E0AFBB80FC2518700C67031 /* HUDIcon.png */,
                                1E027F080D36F23F00885DEE /* Run.png */,
                                1E027F090D36F23F00885DEE /* StepOver.png */,
                                1EC6965712BBC6A700A8D984 /* LICENSE in Resources */,
                                1EC6965912BBC6A700A8D984 /* README.bluestatic in Resources */,
                                1EC6965A12BBC6A700A8D984 /* README.chromium in Resources */,
+                               1E2F0A6912D5371C00EBF675 /* Stop.png in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 2e54020764eba7a419730b5789f27ee848752ef4..efebdcd8505a40cc255f6ae274525781d2814b42 100644 (file)
@@ -80,6 +80,9 @@
 - (void)stepIn;
 - (void)stepOut;
 - (void)stepOver;
+- (void)detach;
+
+// Breakpoint management.
 - (void)addBreakpoint:(Breakpoint*)bp;
 - (void)removeBreakpoint:(Breakpoint*)bp;
 
index 42d8f88ad1e2d7bc094389f76a93ef06a225ceb3..5b5870d39f01bf26108d212a46f5c855b1c04166 100644 (file)
   [self recordCallback:@selector(debuggerStep:) forTransaction:tx];
 }
 
+/**
+ * Ends the current debugging session.
+ */
+- (void)detach
+{
+  [connection_ sendCommandWithFormat:@"detach"];
+  active_ = NO;
+  self.status = @"Stopped";
+  if ([delegate respondsToSelector:@selector(debuggerDisconnected)])
+    [delegate debuggerDisconnected];
+}
+
 /**
  * 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.
index 5fab7a6f210e60daf5a079d562473d18e2c035af..a97868cf77c78b0e5f34183b2377d34980620c8c 100644 (file)
@@ -66,6 +66,7 @@
 - (IBAction)stepIn:(id)sender;
 - (IBAction)stepOut:(id)sender;
 - (IBAction)stepOver:(id)sender;
+- (IBAction)stop:(id)sender;
 
 - (void)fetchChildProperties:(VariableNode*)node;
 
index 96a5ca7743fa184bef74c5bf84bcee06b4dc555b..532411cb312adfcfbb3e41b0ee3cf6b62fe649ac 100644 (file)
@@ -89,6 +89,8 @@
     return ([connection isConnected] && [stackController.stack count] > 1);
   else if (action == @selector(stepIn:) || action == @selector(stepOver:) || action == @selector(run:))
     return [connection isConnected];
+  else if (action == @selector(stop:))
+    return [connection isConnected] && [connection attached];
   
   return [[self window] validateUserInterfaceItem:anItem];
 }
   [connection stepOver];
 }
 
+/**
+ * Forwards the detach/"stop" message to the back end.
+ */
+- (IBAction)stop:(id)sender
+{
+  [connection detach];
+}
+
 - (void)fetchChildProperties:(VariableNode*)node
 {
   NSArray* selection = [stackArrayController selectedObjects];
index f4d27fd0323ff3cc364388867334a10b3e360837..3fa0eab52b3cef3aeaddf55e11f0edecf9299e2e 100644 (file)
Binary files a/dev/Resource Masters/Toolbar Buttons.psd and b/dev/Resource Masters/Toolbar Buttons.psd differ