Robert Sesek [Sun, 17 May 2009 00:12:22 +0000 (20:12 -0400)]
Add a preference to disable automatic step-in upon connection
* English.lproj/Preferences.xib: Add checkbox to the general prefs
* Source/AppDelegate.m: Add NSUserDefaults default value
* Source/DebuggerController.m:
(startDebugger): Check pref before stepping
Robert Sesek [Sat, 16 May 2009 19:02:15 +0000 (15:02 -0400)]
Factored out the stack reloading code
* Source/DebuggerController.m:
(reloadStack): New private method to fetch and insert new stack
(run): Use reloadStack
* Source/GDBpConnection.m+h:
(getCurrentStack): New method to get the stack and create all the stack frames
(run): Return only the current stack frame instead of a whole stack
Robert Sesek [Sat, 4 Apr 2009 20:25:57 +0000 (16:25 -0400)]
Fix the run command by having it obliterate the current stack and set a new one
* Source/GDBpConnection.h+m:
(run): Now returns an NSArray of the new stack frames
(createStackFrame): Sets the StackFrame's index to be the depth
* Source/DebuggerController.m:
(run:): Set the new stack and refresh the source viewer
Robert Sesek [Sat, 4 Apr 2009 03:31:24 +0000 (23:31 -0400)]
Retain the selection in the variable list when stepping through code
* Source/DebuggerController.h: Add the selectedVariable ivar
* Source/DebuggerController.m:
(stepIn:): Save selected variable
(stepOut:): ditto
(stepOver:): ditto
(expandVariables): When looping over variables to expand, also reset the selection
Robert Sesek [Thu, 2 Apr 2009 18:35:58 +0000 (14:35 -0400)]
Have the inspector remember its visibility
* Source/AppDelegate.m:
(load): Set the default value
* Source/DebuggerController.m:
(init): Show/hide the inspector based on prefs
* English.lproj/Debugger.xib: Bind the inspector's visibility
Robert Sesek [Thu, 2 Apr 2009 18:00:24 +0000 (14:00 -0400)]
Add an item to the Window menu to allow the inspector to be shown/hidden
* Source/AppDelegate.m+h:
(showInspectorWindow:): New method
(showBreakpointWindow:): Make this toggle window visibility rather than just always bring to front
* Source/DebuggerController.m+h: Create ivar for the inspector and synth the property
* English.lproj/Debugger.xib: Hook up the outlet
* English.lproj/MainMenu.xib: Add menu item
Robert Sesek [Sun, 15 Feb 2009 16:02:27 +0000 (11:02 -0500)]
Fixed a segfault crash that would occur if you stepped at the end of a script
* Source/GDBpConnection.m:
(stepIn): Update the status before creating the stack frame so we know if we're connected or not
(stepOut): ditto
(stepOver): ditto
Robert Sesek [Tue, 10 Feb 2009 17:40:47 +0000 (12:40 -0500)]
Convert the run command to use the StackFrame system
* Source/GDBpConnection.m+h:
(run): Now returns a StackFrame object
(processData:): Return nil if the given data is nil
(createStackFrame): If we get an empty NSXMLDocument for the stack, return nil
(updateStatus): If the status is nil, the debugger is stopped
* Source/DebuggerController.m:
(run): Use the stack frame
* Source/SocketWrapper.m:
(receive): If the call to recv() returns -1 (error), return nil string
Robert Sesek [Fri, 6 Feb 2009 20:33:44 +0000 (15:33 -0500)]
The breakpoints window will now remember if it was opened or closed
* English.lproj/Breakpoints.xib: Bind the visible status to NSUserDefaults
* Source/AppDelegate.m:
(load): Add the default value for BreakpointsWindowVisible stdudef
* Source/BreakpointController.m:
(init): Only order the window back if BreakpointsWindowVisible is true
Robert Sesek [Fri, 6 Feb 2009 05:57:00 +0000 (00:57 -0500)]
Add a custom NSArrayController for the paths preferences so we can customize the default dictionary values
* English.lproj/Preferences.xib: Update the bindings
* Source/PreferencesPathsArrayController.h+m: New files
* MacGDBp.xcodeproj/project.pbxproj: Project updates for new files
Robert Sesek [Fri, 6 Feb 2009 05:32:10 +0000 (00:32 -0500)]
Add the path management bindings and array controller
* English.lproj/Preferences.xib: Hook up the interface using bindings and NSUserDefaultsController
* Source/AppDelegate.m:
(load): Add a default for the PathReplacements user defaults
Robert Sesek [Fri, 6 Feb 2009 01:26:05 +0000 (20:26 -0500)]
Implement preferences window resizing
* Source/PreferencesController.h: Add blankView ivar
* Source/PreferencesController.m: Create private interface for resizing
(init): Create the blankView
(dealloc): New method
(awakeFromNib): New method
(showGeneral:): Call the resize method
(showPaths:): ditto
(resizeWindowToSize:): New private method
Robert Sesek [Thu, 5 Feb 2009 20:35:54 +0000 (15:35 -0500)]
Implement a toolbar for the preferences window
* Source/AppDelegate.m:
(showPreferences:): Don't call methods on the [prefs window] anymore, but [showPreferencesWindow]
* Source/PreferencesController.m+h: Add toolbar outlet ivars
(showPreferencesWindow): New method
(showGeneral:): New method
(toolbarSelectableItemIdentifiers:): New method
Robert Sesek [Thu, 5 Feb 2009 18:43:12 +0000 (13:43 -0500)]
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"
Robert Sesek [Thu, 22 Jan 2009 19:04:17 +0000 (14:04 -0500)]
Highlighting of the currently debugged file will now get the source from Xdebug rather than reading local files
* Source/BSSourceView.m+h:
(setString:asFile:): New method that will highlight strings rather than files
(scrollToLine:): Change the sanity check to be based off of text in the textStorage, rather than if a file has been set
* Source/DebuggerController.m:
(updateSourceViewer): Use the new setString:asFile: instead of just setFile:
Robert Sesek [Mon, 1 Dec 2008 21:58:42 +0000 (16:58 -0500)]
Fix a couple display issues and a crash
* Source/DebuggerController.m:
(resetDisplays): Clear all the items in the stackController.stack
(updateSourceViewer): If the selection is empty, do not try to clear it. Also, tell the textView to repaint.
Robert Sesek [Mon, 1 Dec 2008 15:38:39 +0000 (10:38 -0500)]
Remove -[DebuggerController setStatus:]
* Source/DebuggerController.h: Header updates
* Source/DebuggerController.m:
(awakeFromNib): Set the window's title and remove the call to [setStatus:]
(setStatus:): Removed
(setError:): Remove call to [setStatus:]
* Source/GDBpConnection.m:
(initWithPort:session:): Set the status to "Connecting"
Robert Sesek [Mon, 1 Dec 2008 15:33:16 +0000 (10:33 -0500)]
Use automatic validation of UI items for the toolbar buttons, rather than manually enabling/disabling them
* Source/DebuggerController.h: Remove the outlets for the toolbar items
* Source/DebuggerController.m:
(validateUserInterfaceItem:): Validate the reconnect button
(setStatus:): Remove the block of code that sets button states
(updateStackViewer): ditto
* English.lproj/Debugger.xib: Remove the outlets and set all the toolbar items to autovalidate
Robert Sesek [Mon, 1 Dec 2008 15:17:12 +0000 (10:17 -0500)]
Remove all references of the window controller from GDBpConnection
* Source/GDBpConnection.h: Removed the windowController ivar and prop
* Source/GDBpConnection.m:
(initWithWindowController:port:session): Renamed to -[initWithPort:session:]
(dealloc): No more windowController
(socketDidAccept:): Change a -[refreshStatus] to an -[updateStatus]
(reconnect): Don't make a call on windowController
* Source/DebuggerController.m:
(init): Use the updated init method for GDBpConnection
Robert Sesek [Mon, 1 Dec 2008 04:06:34 +0000 (23:06 -0500)]
Rather than having GDBpConnection tell the window controller to change status, cache the status as an ivar and bind to it
* Source/GDBpConnection.h: Define the status ivar and make it a prop
* Source/GDBpConnection.m:
(refreshStatus): Remove most of the status-updating code
(updateStatus): New method to fetch and set the status ivar
* English.lproj/Debugger.xib: Bind the status text to GDBpConnection's new status ivar
Robert Sesek [Mon, 1 Dec 2008 03:40:18 +0000 (22:40 -0500)]
Create an error system that follows MVC
* Source/DebuggerController.m:
(init): Register ourselves as an observer for the error notif type
(handleConnectionError:): New method to handle the error notifs
* Source/GDBpConnection.h: Forward-declare kErrorOccurred
* Source/GDBpConnection.m:
(errorEncountered:): Post the notification
Robert Sesek [Mon, 1 Dec 2008 03:18:37 +0000 (22:18 -0500)]
Remove all of the old stack system
* Source/DebuggerController.h: Remove stackController2 and stack ivars
* Source/DebuggerController.m:
(validateUserInterfaceItem:): Update to use stackController.stack for -[count]
(resetDisplays): Remove the call to stackController2
(setStack): Removed
(stepIn:): Call -[updateStackViewer]
(stepOut:): ditto
(stepOver:): ditto
(updateSourceViewer): Use our new stackController
(updateStackViewer): New method
* Source/GDBpConnection.m:
(updateStackTraceAndRegisters): Remove the block of code that used to update the stack
Robert Sesek [Mon, 1 Dec 2008 02:57:23 +0000 (21:57 -0500)]
Update the bindings for the stack viewer to use our new StackController system
* English.lproj/Debugger.xib: Redo the bindings
* Source/DebuggerController.h: Add stackArrayController ivar
* Source/DebuggerController.m:
(awakeFromNib): Set the sort descriptors
(stepIn:): Rearrange the stackArrayController
(stepOut:): ditto
(stepOver): ditto
Robert Sesek [Mon, 1 Dec 2008 01:34:01 +0000 (20:34 -0500)]
The StackFrame index will always be 0 in -[GDBpConnection createStackFrame], so we need to advance it in -[StackController pop] and -[push:]
* Source/GDBpConnection.m:
(createStackFrame): Don't bother getting the "level" property, it will always be 0
* Source/StackController.m:
(pop): Decrease all of the frames' counter
(push:): Increase all of the frames' counter
Robert Sesek [Mon, 1 Dec 2008 01:19:28 +0000 (20:19 -0500)]
Start using our new StackFrame and StackController classes as struts
* Source/DebuggerController.h: Add the stackController ivar
* Source/DebuggerController.m:
(init): Initialize the stackController
(dealloc): Release stackController
(stepIn:): Pop and push the stackController appropriately
(stepOut:): ditto
(stepOver:): ditto
* Source/GDBpConnection.h: -[stepIn] -[stepOut] and -[stepOver] now all return StackFrame objects
* Source/GDBpConnection.m:
(stepIn): Generate and return the frame
(stepOut): ditto
(stepOver): ditto
(createStackFrame): New private method
* Source/StackController.m+h:
(peek): New method
* Source/StackFrame.m+h:
(isShiftedFrame:): New method
(description): Implemented
Robert Sesek [Mon, 13 Oct 2008 15:05:16 +0000 (11:05 -0400)]
Have the debugger and breakpoints windows remember their size and location
* English.lproj/Breakpoints.xib: Set autosave name
* English.lproj/Debugger.xib: ditto
* Source/DebuggerController.m:
(awakeFromNib): Do not call [window center] anymore
Robert Sesek [Wed, 20 Aug 2008 18:50:17 +0000 (14:50 -0400)]
Allow multiple selection and removal of breakpoints
* English.lproj/Breakpoints.xib: Allow multiple selection
* Source/BreakpointController.m:
(removeBreakpoint:): Remove the selection's entirety, instead of the first element
Preferences should be set in +load rather than +initialize, as we can’t rely on AppDelegate receiving a message before any other objects (In this case, DebuggerController was being created first, leading to sockets without the correct default port number).
* Source/AppDelegate.m:
(initialize): Change to load
Robert Sesek [Fri, 1 Aug 2008 17:21:57 +0000 (13:21 -0400)]
Keep breakpoints in the preferences so they are restored at launch
* Source/BreakpointManager.m+h: Add a savedBreakpoints ivar to hold the dictionarys
(addBreakpoint:): Add the breakpoint to the NSUserDefaults
(removeBreakpointAt:inFile:): Remove the breakpoint from NSUserDefaults
Robert Sesek [Mon, 14 Jul 2008 19:13:34 +0000 (15:13 -0400)]
Check and see if stderr has any data on it when syntax highlighting. If so, only show plain text.
* Source/BSSourceView.m:
(initWithFrame): Register to be an observer of the file handle reader notification
(setFile:): Add another pipe for stderr, and read in background from it
(errorHighlightingFile:): New method to handle the notification