Robert Sesek [Wed, 2 Apr 2008 21:26:36 +0000 (17:26 -0400)]
Adding support to actually set breakpoints on the debuger side
* Source/Breakpoint.h: New debuggerId ivar to keep track of the engine's tracking ID
* Source/Breakpoint.m: Synthesize ivar
* Source/DebuggerConnection.m/h:
([DebuggerConnection addBreakpoint:]): New method
([DebuggerConnection removeBreakpoint:]): New method
* Source/DebuggerWindowController.m:
([DebuggerWindowController gutterClickedAtLine:forFile:]): When adding a breakpoint, tell the engine to set it
Robert Sesek [Wed, 2 Apr 2008 18:55:06 +0000 (14:55 -0400)]
Adding a new class called BreakpointManager so we don't clutter up AppDelegate
* Source/AppDelegate.m/h: Removing the breakpoint code
* Source/BSLineNumberView.m:
([BSLineNumberView mouseDown:]): We need to add the lineNumberRange so we get an accurate number
* Source/DebuggerWindowController.m: Switching to BreakpointManager instead of AppDelegate for managing breakpoints
* Source/BreakpointManager.m/h: New files
* MacGDBp.xcodeproj: Project updates for BreakpointManager
Robert Sesek [Wed, 2 Apr 2008 17:53:46 +0000 (13:53 -0400)]
Initial breakpoint adding code
* MacGDBp.xcodeproj: Project updates for Breakpoint.m/h
* Source/AppDelegate.h: Add a breakpoints ivar
* Source/AppDelegate.m:
([AppDelegate addBreakpoint:]): New method
([AppDelegate breakpointsForFile:]): New method
* Source/BSLineNumberView.h: Add a markers ivar
* Source/BSLineNumberView.m:
([BSLineNumberView drawRect:]): Add breakpoint-detecting code
* Source/DebuggerWindowController.m: Making this the delegate of BSSourceView
([DebuggerWindowController gutterClickedAtLine:forFile:]): Implementing delegate method
Robert Sesek [Tue, 1 Apr 2008 04:33:22 +0000 (00:33 -0400)]
We now properly handle the mouseDown event in the gutter
* Source/BSLineNumberView.h: New property called lineNumberRange
* Source/BSLineNumberView.m: Synthesize lineNumberRange and set it to be empty in -[init]
([BSLineNumberView drawRect:]): Set lineNumberRange to be the range of visible lines in the source viewer
([BSLineNumberView mouseDown:]): Use the line number range to simplify the code of determining which line was clicked
* Source/BSSourceView.h: New property file to hold the filename; also create delegate category
* Source/BSSourceView.h: Synthesize file
([BSSourceView setFile:]): Sets the file property as well as setting the string of the textView object
* Source/DebuggerWindowController.m:
([DebuggerWindowController updateSourceViewer]): Use the new -[setFile:] method
Robert Sesek [Sat, 29 Mar 2008 03:02:36 +0000 (23:02 -0400)]
Add an application icon
* Icons/MacGDBp.icns: New icon file
* Info.plist: Add a reference to the icon file
* MacGDBp.xcodeproj: Project updates for the icon file
* Resource Masters/App Icon.psd: New file
* Resource Masters/Globe.ai: New file
* Resource Masters/Toolbar Buttons.psd: Moved from root folder
Robert Sesek [Mon, 10 Mar 2008 19:13:09 +0000 (15:13 -0400)]
Making progress on our -[mouseDown:] event handler, but it's not quite working
* Source/BSLineNumberView.m:
([BSLineNumberView mouseDown:]): New method
* Source/BSSourceView.h: New delegate prop-ivar
* Source/BSSourceView.m: Synthesizing the delegate ivar
Robert Sesek [Sun, 9 Mar 2008 17:13:14 +0000 (13:13 -0400)]
Adding a method to scroll to a given line in the BSSourceView
* Source/BSSourceView.m:
([BSSourceView scrollToLine:]): New method that scrolls to a specific line in the NSTextView
* Source/BSSourceView.h: ditto
* Source/DebuggerWindowController.m:
([DebuggerWindowController updateSourceViewer]): Removing the scrolling logic that used to be here
Robert Sesek [Sun, 9 Mar 2008 16:50:16 +0000 (12:50 -0400)]
We now draw the line number in the the middle of the the line's height, which means that if the line number is a smaller size than the line text it will be centered instead of drawn at the top
Robert Sesek [Sun, 9 Mar 2008 15:03:30 +0000 (11:03 -0400)]
Fixing a memory leak
* Source/NSXMLElementAdditions.m:
([NSXMLElement(NSXMLElementAdditions) value]): base64_decode_alloc() calls malloc() but not free() so we need to do it ourselves
Robert Sesek [Sun, 9 Mar 2008 04:38:07 +0000 (23:38 -0500)]
Add a bunch of new NSView classes (to form a meta-view BSSourceView) that adds a line-numbered NSTextView embedded in a NSScrollView
* English.lproj/Debugger.xib: Use our BSSourceView instead of an NSTextView for the source viewer
* Source/BSLineNumberView.h: new file
* Source/BSLineNumberView.m: new file
* Source/BSSourceView.h: new file
* Source/BSSourceView.m: new file
* Source/BSSourceViewTextView.h: new file
* Source/BSSourceViewTextView.m: new file
* MacGDBp.xcodeproj: Project updates for all the new files
* Source/DebuggerWindowController.h: Switch to using a BSSourceView
* Source/DebuggerWindowController.m: ditto
Robert Sesek [Fri, 11 Jan 2008 01:07:20 +0000 (17:07 -0800)]
Converting the rest of the NIBs to be XIBs simply for the sake of consistency
* English.lproj/Connect.nib: Removed
* English.lproj/MainMenu.nib: Removed
* English.lproj/Connect.xib: New file
* English.lproj/MainMenu.xib: New file
* MacGDBp.xcodeproj: Project updates for removed NIBs and new XIBs, also put all the XIBs into a group for organization sake
Robert Sesek [Fri, 11 Jan 2008 00:10:17 +0000 (16:10 -0800)]
We were previously using, for the stack table, the index of the row to determine which source file to show instead of the "level" column of the row, which means sorting the stack table would screw things up
* Source/DebuggerWindowController.m:
([DebuggerWindowController updateSourceViewer]): Switch to using the selected item's "level" rather than the selected row index
Robert Sesek [Thu, 10 Jan 2008 00:11:51 +0000 (16:11 -0800)]
Instead of using NSSplitView, use BSSplitView which is our custom implementation which draws a smaller, gradiated divider
* English.lproj/Debugger.xib: Switch to using a custom class for our two SplitView's
* Source/BSSplitView.h: New file
* Source/BSSplitView.m: ditto
* MacGDBp.xcodeproj: Project updates for new files
Robert Sesek [Wed, 9 Jan 2008 23:26:52 +0000 (15:26 -0800)]
Adding some icons for the toolbar buttons (only Step In and Step Out)
* English.lproj/Debugger.xib: Set the icons for the two buttons
* Icons/StepIn.png: New file
* Icons/StepOut.png: ditto
* MacGDBp.xcodeproj: Project updates to add the icons to the resources
* Toolbar Buttons.psd: Original file for the icons
Robert Sesek [Wed, 9 Jan 2008 09:22:09 +0000 (01:22 -0800)]
Use an NSToolbar for the debugger controls instead of NSButtons
* English.lproj/Debugger.nib: Removed because the designable NSToolbar requires an XIB
* English.lproj/Debugger.xib: Coverted old NIB
* MacGDBp.xcodeproj: Project updates for the nib->xib conversion
* Source/DebuggerWindowController.h: Changing the buttons to be of type NSButton to NSToolbarItem
Robert Sesek [Wed, 9 Jan 2008 09:05:22 +0000 (01:05 -0800)]
The reconnect functionality now works
* Source/DebuggerConnection.h:
* Source/DebuggerConnection.m:
([DebuggerConnection reconnect]): New method that communicates the reconnect to the debugger
([Debuggerconnection refreshStatus]): If the status is "stopped", we are no longer connected
* Source/DebuggerWindowController.h:
* Source/DebuggerWindowController.m:
([DebuggerWindowController resetDisplays]): New method to set all the display information to be blank
([DebuggerWindowController reconnect:]): Forward the message to reconnect to the DebuggerConnection
Robert Sesek [Sun, 6 Jan 2008 01:14:00 +0000 (17:14 -0800)]
The registers now have memory and stay expanded
* Source/DebuggerWindowController.h: expandedRegisters is now an NSMutableSet
* Source/DebuggerWindowController.m:
([DebuggerWindowController initWithPort:session:]): Change allocated type of expandedRegisters
([DebuggerWindowController setRegister:]): Finished logic for expanding remembered registers
([DebuggerWindowController outlineViewItemDidExpand:]): Use the "fullname" attribute to get the full variable name so scope is accounted for in expanded memory
([DebuggerWindowController outlineViewItemDidCollapse:]): ditto
* Source/NSXMLElementAdditions.h:
* Source/NSXMLElementAdditions.m:
([NSXMLElement(NSXMLElementAdditions) fullname]): New method
Robert Sesek [Sun, 6 Jan 2008 00:50:56 +0000 (16:50 -0800)]
We now properly fetch registers who need to have more data attached
* Source/DebuggerWindowController.m:
([DebuggerWindowController addChildren:toNode:]): Don't attach nodes through the controller, but rather through the XMLElement (via the node's -[representedObject])
Robert Sesek [Sat, 5 Jan 2008 23:55:52 +0000 (15:55 -0800)]
Removing the notification-delegate system that SocketWrapper used because it wasn't necessary because the only action that can block the UI is -[connect]
Changes:
-[SocketWrapper receive] now returns the data directly, cleaning up the DebuggerConnection class a lot
-[SocketWrapper send] returns BOOL depending on the success of the send
Robert Sesek [Sat, 5 Jan 2008 23:09:16 +0000 (15:09 -0800)]
In SocketWraper, don't use the notification posting system to send errors to the delegate, instead just use performSelectorOnMainThread:withObject:waitUntilDone: on the delegate object. Also, -[NSObject(SocketWrapperDelegate) errorEncountered:] now just takes a string.
Robert Sesek [Sat, 5 Jan 2008 22:54:50 +0000 (14:54 -0800)]
Synthesize new properties for class cross-referencing and SocketWrapper now init's with a DebuggerConnection
* Source/DebuggerConnection.h: New property for the DebuggerWindowController
* Source/DebuggerConnection.m: Synthesize new property and changed SocketWrapper's initializer
* Source/DebuggerWindowController.h: New property for DebuggerConnection
* Source/DebuggerWindowController.m: ditto
* Source/SocketWrapper.h: The init method now takes a DebuggerConnection (and stores it) instead of a port
* Source/SocketWrapper.m: ditto
Robert Sesek [Sat, 5 Jan 2008 22:07:07 +0000 (14:07 -0800)]
Finish the refactoring in the previous commit and now the window title is properly set
* Source/DebuggerConnection.h: Removed the definition for -[windowDidClose]
* Source/DebuggerConnection.m:
([DebuggerConnection initWithWindowController:port:session:]): Don't set the status in this method because the nib isn't awake yet
* Source/DebuggerWindowController.m:
([DebuggerWindowController initWithPort:session:]): Make self key and front
([DebuggerWindowController awakeFromNib]): Set the default status to be "Connecting"
([DebuggerWindowController windowWillClose:]): Removed
Robert Sesek [Sat, 5 Jan 2008 21:54:55 +0000 (13:54 -0800)]
We no longer use DebuggerConnection to manage the DebuggerWindowController, but now it's vice versa
Benefits:
- There was a problem that when we quit we would crash, because on window closing, the WindowController would tell the connection to shutdown, but because AppDelegate cleaned up before the WindowController, it would crash when sending the message.
- An array of connections no longer needs to be managed because the WindowController stores all the pointers, so when it closes things are deallocated properly
Robert Sesek [Fri, 4 Jan 2008 10:24:40 +0000 (02:24 -0800)]
We can't have an instance variable match the name of a C function because then we don't compile
* Source/SocketWrapper.h: ivar socket is now sock
* Source/SocketWrapper.m:
([SocketWrapper connect:]): We're now happy because socket() can be called without ambiguity between self->socket
Robert Sesek [Sat, 25 Aug 2007 05:36:12 +0000 (22:36 -0700)]
Improving the way we handle updating the stack and registers. Instead of updating them after we send step/run commands, only update the stacks and registers if the status (in updateStatus:) is on "break"
Robert Sesek [Sat, 11 Aug 2007 23:21:03 +0000 (16:21 -0700)]
Renaming the "Refresh" butto to be "Re-Connect" and hooking it up (though it does nothing at the moment)
* English.lproj/Debugger.nib: Renaming the "Run" button and hooking it up to DebuggerWindowController
* Source/DebuggerWindowController.m|h: Adding a _reconnectButton outlet and a reconnect: action
([DebuggerWindowController reconnect:]): New method
Robert Sesek [Sat, 11 Aug 2007 22:52:36 +0000 (15:52 -0700)]
In the dataReceived: method if an error is in the response, set the error on the window
* Source/DebuggerConnection.m:
([DebuggerConnection dataReceived:deliverTo:]): If the response XML contains an error tag, set the error of the window to be the error message
Robert Sesek [Sat, 11 Aug 2007 19:54:55 +0000 (12:54 -0700)]
We previously were leaking all over the place due to improper use of memory management techniques and circular references
* English.lproj/Debugger.nib: Setting DebuggerWindowController as the window's delgate
* Source/AppDelegate.h: Adding a connections ivar
* Source/AppDelegate.m:
([AppDelegate init]): New method to initialize the connections array
([AppDelegate applicationWillTerminate:]): Frees the connections array
([AppDelegate registerConnection:]): New method to register a DebuggerConnection
([AppDelegate unregisterConnection:]): Unregisters a DebuggerConnection
* Source/ConnectWindowController.m:
([ConnectWindowController connect:]): We weren't properly release'ing the connection, so now we register it with the delegate and release it in the connect method
* Source/DeubggerConnection.h: Added a windowDidClose method so that the window controller can forward the message
* Source/DebuggerConnection.m:
([DebuggerConnection windowDidClose]): New method to forward the windowWillClose notification
([DebuggerConnection initWithPort:session:]): We no longer have to register for NSApplicationWillTerminate
([DebuggerConnection applicationWillTerminate:]): Removed
([DebuggerConnection dealloc]): Release _windowController
* Source/DebuggerWindowController.m:
([DebuggerWindowController initWithConnection:]): No longer retain the connection as it creates a circular ref
([DebuggerWindowController windowWillClose:]): Use this delegate method to buble the notification to the controller
([DebuggerWindowController dealloc]): Since we don't retain _connection, don't release it
* Source/SocketWrapper.m:
([SocketWrapper dealloc]): Remove ourselves as a notification observer so we don't have a nil reference
Robert Sesek [Mon, 6 Aug 2007 16:57:57 +0000 (09:57 -0700)]
We now remember which items in the register have been expanded so they stay open
* Source/DebuggerWindowController.h: Adding an _registerView outlet and an _expandedRegisters array
* Source/DebuggerWindowController.m:
([DebuggerWindowController initWithConnection:]): Initialize _expandedRegisters
([DebuggerWindowController dealloc]): Release _expandedRegisters
([DebuggerWindowController setRegister:]): When we set the register, go through all the items and see if any of them should be expanded
([DebuggerWindowController outlineViewItemDidExpand:]): Add the expanded object to _expandedRegisters
([DebuggerWindowController outlineViewItemDidCollapse:]): Remove the object from _expandedRegisters
* English.lproj/Debugger.nib: Hooking up the _registerView outlet
Robert Sesek [Sun, 5 Aug 2007 21:04:34 +0000 (14:04 -0700)]
Working around an extremely annoying apple bug in NSTreeController and an NSOutlineView. When the contentArray is bound on an NSTreeController, the observing can go haywire and just crash randomly.
* English.lproj/Debugger.nib: Unbinding RegisterController's content array
* Source/DebuggerConnection.m:
([DebuggerConnection registerRecieved:]): Sending [_windowController setRegister:] the entire document instead of the rootElement
* Source/DebuggerWindowController.h: Removed _register ivar and changed setRegister: to take an NSXMLDocument
* Source/DebuggerWindowController.m:
([DebuggerWindowController setRegister:]): Instead of changing a property and letting KVO do the work (and subsequently and randomly crash), force the controller to have new content
Robert Sesek [Sun, 5 Aug 2007 20:20:34 +0000 (13:20 -0700)]
Casting to remove a warning
* Source/DebuggerConnection.m:
([DebuggerConnection propertyRecieved:]): Casting parent to be an NSXMLElement because childAtIndex returns an NSXMLNode
Robert Sesek [Sun, 5 Aug 2007 19:55:34 +0000 (12:55 -0700)]
Making the buttons change their enabled state depending on where we are in debugging
* Source/DebuggerWindowController.m:
([DebuggerWindowController setStatus:]): Disable all the buttons and reenable "step in" and "run" if we're connected
([DebuggerWindowController setStack:]): Enable the step in/out/over and run buttons appropriately