From 03f4659640e18499434614493563795c2d3819d3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 15:18:52 -0400 Subject: [PATCH 01/16] Instead of using NSData for [SocketWrapper receive], use NSString * Source/DebuggerConnection.m: ([processData:]): Use NSString instead of NSData * Source/SocketWrapper.m+h: ([receive]): Return an NSString --- Source/DebuggerConnection.m | 8 ++++---- Source/SocketWrapper.h | 2 +- Source/SocketWrapper.m | 11 ++++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index fc75d53..10b3c47 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -20,7 +20,7 @@ @interface DebuggerConnection (Private) - (NSString *)createCommand:(NSString *)cmd; -- (NSXMLDocument *)processData:(NSData *)data; +- (NSXMLDocument *)processData:(NSString *)data; @end @@ -269,15 +269,15 @@ /** * Helper function to parse the NSData into an NSXMLDocument */ -- (NSXMLDocument *)processData:(NSData *)data +- (NSXMLDocument *)processData:(NSString *)data { NSError *parseError = nil; - NSXMLDocument *doc = [[NSXMLDocument alloc] initWithData:data options:NSXMLDocumentTidyXML error:&parseError]; + NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:data options:0 error:&parseError]; if (parseError) { NSLog(@"Could not parse XML? --- %@", parseError); NSLog(@"Error UserInfo: %@", [parseError userInfo]); - NSLog(@"This is the XML Document: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); + NSLog(@"This is the XML Document: %@", data); return nil; } diff --git a/Source/SocketWrapper.h b/Source/SocketWrapper.h index ee170af..1501393 100644 --- a/Source/SocketWrapper.h +++ b/Source/SocketWrapper.h @@ -35,7 +35,7 @@ - (void)connect; - (void)close; -- (NSData *)receive; +- (NSString *)receive; - (BOOL)send:(NSString *)data; - (NSString *)remoteHost; diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index 77e8cda..8d6e094 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -156,7 +156,7 @@ * is used either in a threaded environment so the interface does not hang, or when you *know* the server * will return something (which we almost always do). Returns the data that was received from the socket. */ -- (NSData *)receive +- (NSString *)receive { // create a buffer char buffer[1024]; @@ -166,6 +166,7 @@ // take the received data and put it into an NSData NSMutableData *data = [NSMutableData data]; + NSMutableString *str = [NSMutableString string]; // strip the length from the packet, and clear the null byte then add it to the NSData char packetLength[8]; @@ -188,8 +189,8 @@ memset(packet, '\0', sizeof(packet)); memmove(packet, &buffer[i], recvd - i); - // convert bytes to NSData - [data appendBytes:packet length:recvd - i]; + // convert bytes to NSString + [str appendString:[[NSString alloc] initWithCString:packet length:recvd - i]]; // check if we have a partial packet if (length + i > sizeof(buffer)) @@ -202,12 +203,12 @@ [self error:@"Socket closed or could not be read"]; return nil; } - [data appendBytes:buffer length:latest]; + [str appendString:[[NSString alloc] initWithCString:buffer length:latest]]; recvd += latest; } } - return data; + return [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; } /** -- 2.22.5 From c05a3e7926f5f59da607db89924159d56f965f75 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 15:27:42 -0400 Subject: [PATCH 02/16] We don't want the NULL byte at the end of the NSString when we call -receive: * Source/SocketWrapper.m: ([receive]): Substring to the last byte --- Source/SocketWrapper.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index 8d6e094..f0dfb89 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -165,7 +165,6 @@ int recvd = recv(sock, &buffer, sizeof(buffer), 0); // take the received data and put it into an NSData - NSMutableData *data = [NSMutableData data]; NSMutableString *str = [NSMutableString string]; // strip the length from the packet, and clear the null byte then add it to the NSData @@ -208,7 +207,8 @@ } } - return [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + NSString *tmp = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // strip whitespace + return [tmp substringToIndex:[tmp length] - 1]; // don't want the null byte } /** -- 2.22.5 From 8224acb2fc41ab0316114abf04e1fd7c656c174f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 16:15:51 -0400 Subject: [PATCH 03/16] Make the stack text be the same size as the register text * English.lproj/Debugger.xib --- English.lproj/Debugger.xib | 53 ++++++++++++++------------------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/English.lproj/Debugger.xib b/English.lproj/Debugger.xib index d61c3b3..b998d6e 100644 --- a/English.lproj/Debugger.xib +++ b/English.lproj/Debugger.xib @@ -2,13 +2,13 @@ 1050 - 9C7010 - 644 - 949.26 + 9D34 + 667 + 949.33 352.00 YES - + YES @@ -391,6 +391,8 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES + {3.40282e+38, 3.40282e+38} + {213, 107} 256 @@ -437,7 +439,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 67239424 272629760 PHN0YXR1cz4 - + LucidaGrande 1.100000e+01 16 @@ -698,7 +700,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ YES - 1.000000e+01 + 3.000000e+01 1.000000e+01 3.000000e+01 @@ -716,11 +718,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 337772096 2048 Text Cell - - LucidaGrande - 1.300000e+01 - 1044 - + @@ -730,7 +728,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 1.763853e+02 + 1.060000e+02 8.000000e+00 1.000000e+03 @@ -745,7 +743,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 337772096 2048 Text Cell - + @@ -755,7 +753,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 4.000000e+01 + 2.600000e+01 2.600000e+01 1.000000e+03 @@ -770,7 +768,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 337772096 2048 Text Cell - + @@ -780,7 +778,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ - 1.440625e+02 + 2.080000e+02 5.006250e+01 1.000000e+03 @@ -795,7 +793,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 337772096 2048 Text Cell - + @@ -831,12 +829,12 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ _doScroller: - 9.951220e-01 + 9.268293e-01 -2147483392 - {{1, 207}, {367, 15}} + {{1, 207}, {382, 15}} 1 @@ -891,7 +889,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{0, 0}, {1440, 878}} - {213, 185} + {213, 169} {3.40282e+38, 3.40282e+38} @@ -1663,7 +1661,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ 7.ImportedFromIB2 7.NSWindowTemplate.visibleAtLaunch 7.editorWindowContentRectSynchronizationRect - 7.lastResizeAction 7.windowTemplate.hasMaxSize 7.windowTemplate.hasMinSize 7.windowTemplate.maxSize @@ -1743,19 +1740,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ {{344, 269}, {769, 501}} - - YES - - YES - IBResizeActionFinalFrame - IBResizeActionInitialFrame - - - YES - {{342, 237}, {769, 501}} - {{342, 237}, {769, 501}} - - {3.40282e+38, 3.40282e+38} @@ -1887,6 +1871,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ FirstResponder + NSObject IBUserSource -- 2.22.5 From 8816565e4b12a3b239d0a7cb2c8b452f37ca0965 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 21:28:10 -0400 Subject: [PATCH 04/16] Comment out the saving of breakpoints to NSUserDefaults because it's generating a lot of noise * Source/BreakpointManager: (addBreakpoint:) (removeBreakpointAt:inFile:) --- Source/BreakpointManager.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index 7c0fbd6..b4b4406 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -64,8 +64,9 @@ NSString *kdBreakpoints = @"breakpoints"; { [lines addObject:bp]; } - [[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; - NSLog(@"breakpoints = %@", breakpoints); + // TODO: use NSDictionary to store breakoints because we can only archive defaults in NSUserDefaults + //[[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; + //NSLog(@"breakpoints = %@", breakpoints); } /** @@ -79,7 +80,8 @@ NSString *kdBreakpoints = @"breakpoints"; if ([b line] == line) { [lines removeObject:b]; - [[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; + // TODO: use NSDictionary + //[[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; return b; } } -- 2.22.5 From 228b5447861b95e79ecc705b481ed12980957cb3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 21:29:54 -0400 Subject: [PATCH 05/16] Sending the "run" command was balanced with a receive command * Source/DebuggerConnection.m: (run): Message the socket to -[receive] --- Source/DebuggerConnection.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index 10b3c47..c1d260d 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -124,6 +124,7 @@ - (void)run { [socket send:[self createCommand:@"run"]]; + [socket receive]; [self refreshStatus]; } -- 2.22.5 From a8168fd02ac3797f37d47459f768899cf35c4738 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Jun 2008 21:39:16 -0400 Subject: [PATCH 06/16] When calling -[SocketWrapper remoteHost], we don't want to continually query the hostname * Source/SocketWrapper.h: Adding a hostname ivar * Source/SocketWrapper.m: (remoteHost): Just return the hostname ivar (connect:): Query the hostname and store it in the hostname ivar --- Source/SocketWrapper.h | 1 + Source/SocketWrapper.m | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/SocketWrapper.h b/Source/SocketWrapper.h index 1501393..2877df8 100644 --- a/Source/SocketWrapper.h +++ b/Source/SocketWrapper.h @@ -24,6 +24,7 @@ int port; int sock; + NSString *hostname; id delegate; } diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index f0dfb89..7092e19 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -71,17 +71,7 @@ */ - (NSString *)remoteHost { - struct sockaddr_in addr; - socklen_t addrLength; - - if (getpeername(sock, (struct sockaddr *)&addr, &addrLength) < 0) - { - [self error:@"Could not get remote hostname."]; - } - - char *name = inet_ntoa(addr.sin_addr); - - return [NSString stringWithUTF8String:name]; + return hostname; } /** @@ -147,6 +137,15 @@ // we're done listening now that we have a connection close(socketOpen); + struct sockaddr_in addr; + socklen_t addrLength; + if (getpeername(sock, (struct sockaddr *)&addr, &addrLength) < 0) + { + [self error:@"Could not get remote hostname."]; + } + char *name = inet_ntoa(addr.sin_addr); + hostname = [NSString stringWithUTF8String:name]; + [connection performSelectorOnMainThread:@selector(socketDidAccept:) withObject:nil waitUntilDone:NO]; } -- 2.22.5 From fc4c89c9100e5dda506f83f76848e9f738062b82 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 6 Jun 2008 13:58:17 -0400 Subject: [PATCH 07/16] Reorganizing the project source files into groups * MacGDBp.xcodeproj --- MacGDBp.xcodeproj/project.pbxproj | 44 +++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 5315b6d..6bcb3ad 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -95,20 +95,8 @@ children = ( 1E02C3D30C60EC2C006F1752 /* AppDelegate.h */, 1E02C3D40C60EC2C006F1752 /* AppDelegate.m */, - 1E02C56F0C610158006F1752 /* DebuggerConnection.h */, - 1E02C5700C610158006F1752 /* DebuggerConnection.m */, - 1E02C5F40C610724006F1752 /* DebuggerWindowController.h */, - 1E02C5F50C610724006F1752 /* DebuggerWindowController.m */, - 1EEEE93E0C618B70000C0732 /* SocketWrapper.h */, - 1EEEE93F0C618B70000C0732 /* SocketWrapper.m */, - 1E35FFB00C65A74C0030F527 /* NSXMLElementAdditions.h */, - 1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */, - 1EEBFD080D3599E8008F835B /* BSSplitView.h */, - 1EEBFD070D3599E8008F835B /* BSSplitView.m */, - 1E822CDB0DA28AC30027A23F /* Breakpoint.h */, - 1E822CDC0DA28AC30027A23F /* Breakpoint.m */, - 1E4C7AF70DA401C7000A9DC7 /* BreakpointManager.h */, - 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */, + 1E1E52C10DF9B1FB00D334F9 /* Connection */, + 1E1E52C00DF9B1E700D334F9 /* Breakpoints */, 1E71886C0D839F6C00969277 /* Source View */, ); name = Classes; @@ -152,6 +140,32 @@ name = "Toolbar Icons"; sourceTree = ""; }; + 1E1E52C00DF9B1E700D334F9 /* Breakpoints */ = { + isa = PBXGroup; + children = ( + 1E822CDB0DA28AC30027A23F /* Breakpoint.h */, + 1E822CDC0DA28AC30027A23F /* Breakpoint.m */, + 1E4C7AF70DA401C7000A9DC7 /* BreakpointManager.h */, + 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */, + ); + name = Breakpoints; + sourceTree = ""; + }; + 1E1E52C10DF9B1FB00D334F9 /* Connection */ = { + isa = PBXGroup; + children = ( + 1E02C56F0C610158006F1752 /* DebuggerConnection.h */, + 1E02C5700C610158006F1752 /* DebuggerConnection.m */, + 1E02C5F40C610724006F1752 /* DebuggerWindowController.h */, + 1E02C5F50C610724006F1752 /* DebuggerWindowController.m */, + 1EEEE93E0C618B70000C0732 /* SocketWrapper.h */, + 1EEEE93F0C618B70000C0732 /* SocketWrapper.m */, + 1E35FFB00C65A74C0030F527 /* NSXMLElementAdditions.h */, + 1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */, + ); + name = Connection; + sourceTree = ""; + }; 1E416FFB0D36F827009A53A2 /* Interfaces */ = { isa = PBXGroup; children = ( @@ -164,6 +178,8 @@ 1E71886C0D839F6C00969277 /* Source View */ = { isa = PBXGroup; children = ( + 1EEBFD080D3599E8008F835B /* BSSplitView.h */, + 1EEBFD070D3599E8008F835B /* BSSplitView.m */, 1E7188620D839F6300969277 /* BSLineNumberView.h */, 1E7188630D839F6300969277 /* BSLineNumberView.m */, 1E7188640D839F6300969277 /* BSSourceView.h */, -- 2.22.5 From 381baa3eacb249b79a2657a705b06ff4ef19f110 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 6 Jun 2008 14:08:02 -0400 Subject: [PATCH 08/16] Adding NSDictionary archiving and unarchiving abilities to Breakpoint * Source/Breakpoint.m+h: (initWithDictionary:): New method (dictionary): New method --- Source/Breakpoint.h | 3 +++ Source/Breakpoint.m | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Source/Breakpoint.h b/Source/Breakpoint.h index 3422155..b8bfa27 100644 --- a/Source/Breakpoint.h +++ b/Source/Breakpoint.h @@ -29,5 +29,8 @@ @property(readwrite, assign) int debuggerId; - (id)initWithLine:(int)l inFile:(NSString *)f; +- (id)initWithDictionary:(NSDictionary *)dict; + +- (NSDictionary *)dictionary; @end diff --git a/Source/Breakpoint.m b/Source/Breakpoint.m index 26f5f8e..e91224d 100644 --- a/Source/Breakpoint.m +++ b/Source/Breakpoint.m @@ -34,6 +34,19 @@ return self; } +/** + * Creates a Breakpoint from the values of an NSDictionary + */ +- (id)initWithDictionary:(NSDictionary *)dict +{ + if (self = [super init]) + { + file = [dict valueForKey:@"file"]; + line = [[dict valueForKey:@"line"] intValue]; + } + return self; +} + /** * Determines if two breakpoints are equal */ @@ -50,6 +63,14 @@ return ([file hash] << 8) + line; } +/** + * Returns an NSDictionary of the data so it can be stored in NSUserDefaults + */ +- (NSDictionary *)dictionary +{ + return [NSDictionary dictionaryWithObjectsAndKeys:file, @"file", [NSNumber numberWithInt:line], @"line", nil]; +} + /** * Pretty-print */ -- 2.22.5 From 2825be20e33bcd87b488442547413083bbe60ddc Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 6 Jun 2008 14:22:34 -0400 Subject: [PATCH 09/16] We aren't going to store breakpoints in NSUserDefaults * Source/BreakpointManager.m: (init): Removed the NSUserDefaults loading (addBreakpoint:): Don't add it to NSUserDefaults (removeBreakpoint:): ditto --- Source/BreakpointManager.m | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index b4b4406..b1a1f16 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -16,8 +16,6 @@ #import "BreakpointManager.h" -NSString *kdBreakpoints = @"breakpoints"; - @implementation BreakpointManager /** @@ -27,10 +25,9 @@ NSString *kdBreakpoints = @"breakpoints"; { if (self = [super init]) { - breakpoints = (NSMutableDictionary *)[[NSUserDefaults standardUserDefaults] objectForKey:kdBreakpoints]; if (!breakpoints) { - breakpoints = [NSMutableDictionary dictionary]; + breakpoints = [[NSMutableDictionary alloc] init]; } } return self; @@ -64,9 +61,6 @@ NSString *kdBreakpoints = @"breakpoints"; { [lines addObject:bp]; } - // TODO: use NSDictionary to store breakoints because we can only archive defaults in NSUserDefaults - //[[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; - //NSLog(@"breakpoints = %@", breakpoints); } /** @@ -80,8 +74,6 @@ NSString *kdBreakpoints = @"breakpoints"; if ([b line] == line) { [lines removeObject:b]; - // TODO: use NSDictionary - //[[NSUserDefaults standardUserDefaults] setObject:breakpoints forKey:kdBreakpoints]; return b; } } -- 2.22.5 From 6f18088b2487b3811fa5c23ea5ff0bfb8e406d3e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jun 2008 15:43:39 -0400 Subject: [PATCH 10/16] Adding Breakpoints.xib for the breakpoints manager * English.lproj/Breakpoints.xib: New file * MacGDBp.xcodeproj: Project updates for the new XIB --- English.lproj/Breakpoints.xib | 658 ++++++++++++++++++++++++++++++ MacGDBp.xcodeproj/project.pbxproj | 12 + 2 files changed, 670 insertions(+) create mode 100644 English.lproj/Breakpoints.xib diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib new file mode 100644 index 0000000..52850c3 --- /dev/null +++ b/English.lproj/Breakpoints.xib @@ -0,0 +1,658 @@ + + + + 1050 + 9D34 + 667 + 949.33 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + NSObject + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 25}, {574, 484}} + 536870912 + Window + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 256 + + YES + + + 274 + + YES + + + 256 + {574, 217} + + BSSourceView + + + + 256 + + YES + + + 268 + + YES + + + 2304 + + YES + + + 256 + {557, 206} + + YES + + + 256 + {557, 17} + + + + + + 256 + {{558, 0}, {16, 17}} + + + + YES + + 1.010000e+02 + 4.000000e+01 + 1.000000e+03 + + 75628032 + 0 + + + LucidaGrande + 1.100000e+01 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2048 + Text Cell + + LucidaGrande + 1.300000e+01 + 1044 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + + + 3 + YES + YES + + + + 4.500000e+02 + 4.000000e+01 + 1.000000e+03 + + 75628032 + 0 + + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3.000000e+00 + 2.000000e+00 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 1.700000e+01 + -700448768 + 4 + 15 + 0 + YES + + + {{1, 17}, {557, 206}} + + + + + 4 + + + + 256 + {{558, 17}, {15, 206}} + + + _doScroller: + 3.700000e+01 + 1.947368e-01 + + + + 256 + {{1, 223}, {557, 15}} + + 1 + + _doScroller: + 5.714286e-01 + + + + 2304 + + YES + + + {{1, 0}, {557, 17}} + + + + + 4 + + + + {{0, 19}, {574, 239}} + + + 50 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + {{0, -2}, {24, 23}} + + YES + + -2080244224 + 134217728 + + + + -2033434369 + 162 + + NSImage + NSAddTemplate + + + + 400 + 75 + + + + + 268 + {{-1, -2}, {24, 23}} + + YES + + -2080244224 + 134217728 + + + + -2033434369 + 162 + + + + 400 + 75 + + + + + 268 + {{22, -2}, {24, 23}} + + YES + + -2080244224 + 134217728 + + + + -2033434369 + 162 + + NSImage + NSRemoveTemplate + + + + 400 + 75 + + + + {{0, 226}, {574, 258}} + + NSView + + + {574, 484} + + + + {574, 484} + + + {{0, 0}, {1680, 1028}} + {3.40282e+38, 3.40282e+38} + + + + + YES + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + + 4 + + + YES + + + + + 5 + + + YES + + + + + + + + + 10 + + + YES + + + + + + + + + 11 + + + + + 12 + + + + + 13 + + + YES + + + + + + + 14 + + + + + 15 + + + YES + + + + + + 16 + + + YES + + + + + + 17 + + + + + 18 + + + + + 19 + + + YES + + + + + + 20 + + + + + 21 + + + YES + + + + + + 22 + + + + + 23 + + + YES + + + + + + 24 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 19.IBPluginDependency + 2.IBPluginDependency + 20.IBPluginDependency + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBPluginDependency + 24.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + {{398, 290}, {574, 484}} + com.apple.InterfaceBuilder.CocoaPlugin + {{398, 290}, {574, 484}} + + {196, 240} + {{202, 428}, {480, 270}} + 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 + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 24 + + + + YES + + BSSourceView + NSView + + delegate + id + + + IBProjectSource + Source/BSSourceView.h + + + + BSSplitView + NSSplitView + + IBProjectSource + Source/BSSplitView.h + + + + NSObject + + + + NSObject + + IBProjectSource + Source/SocketWrapper.h + + + + + 0 + ../MacGDBp.xcodeproj + 3 + + diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 6bcb3ad..6008d5f 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 1E02C3D50C60EC2C006F1752 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E02C3D40C60EC2C006F1752 /* AppDelegate.m */; }; 1E02C5710C610158006F1752 /* DebuggerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E02C5700C610158006F1752 /* DebuggerConnection.m */; }; 1E02C5F60C610724006F1752 /* DebuggerWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E02C5F50C610724006F1752 /* DebuggerWindowController.m */; }; + 1E1E53030DF9B89800D334F9 /* Breakpoints.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E1E53010DF9B89800D334F9 /* Breakpoints.xib */; }; 1E35FC760C6579CA0030F527 /* NSXMLElementAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */; }; 1E35FEA10C6599040030F527 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E35FEA00C6599040030F527 /* base64.c */; }; 1E416FF90D36F821009A53A2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E416FF60D36F821009A53A2 /* MainMenu.xib */; }; @@ -46,6 +47,7 @@ 1E02C5700C610158006F1752 /* DebuggerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DebuggerConnection.m; path = Source/DebuggerConnection.m; sourceTree = ""; }; 1E02C5F40C610724006F1752 /* DebuggerWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebuggerWindowController.h; path = Source/DebuggerWindowController.h; sourceTree = ""; }; 1E02C5F50C610724006F1752 /* DebuggerWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DebuggerWindowController.m; path = Source/DebuggerWindowController.m; sourceTree = ""; }; + 1E1E53020DF9B89800D334F9 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Breakpoints.xib; sourceTree = ""; }; 1E35FC750C6579CA0030F527 /* NSXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSXMLElementAdditions.m; path = Source/NSXMLElementAdditions.m; sourceTree = ""; }; 1E35FE9F0C6599040030F527 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = Source/base64.h; sourceTree = ""; }; 1E35FEA00C6599040030F527 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = base64.c; path = Source/base64.c; sourceTree = ""; }; @@ -171,6 +173,7 @@ children = ( 1EEBFBE30D34C793008F835B /* Debugger.xib */, 1E416FF60D36F821009A53A2 /* MainMenu.xib */, + 1E1E53010DF9B89800D334F9 /* Breakpoints.xib */, ); name = Interfaces; sourceTree = ""; @@ -289,6 +292,7 @@ 1E027F390D36F60800885DEE /* Reconnect.png in Resources */, 1E416FF90D36F821009A53A2 /* MainMenu.xib in Resources */, 1EEE875D0D9DE4B4009CBA7C /* MacGDBp.icns in Resources */, + 1E1E53030DF9B89800D334F9 /* Breakpoints.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -342,6 +346,14 @@ name = InfoPlist.strings; sourceTree = ""; }; + 1E1E53010DF9B89800D334F9 /* Breakpoints.xib */ = { + isa = PBXVariantGroup; + children = ( + 1E1E53020DF9B89800D334F9 /* English */, + ); + name = Breakpoints.xib; + sourceTree = ""; + }; 1E416FF60D36F821009A53A2 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( -- 2.22.5 From e80de8d11cec6662fbf29ecb292fd3a00c209191 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jun 2008 15:51:01 -0400 Subject: [PATCH 11/16] Adding a breakpoints NSWindowController for Breakpoints.xib * Source/BreakpointWindowController.m+h: New files * MacGDBp.xcodeproj: Project updates for BreakpointWindowController * Source/AppDelegate.m+h: (showBreakpointWindow:): New method * English.lproj/MainMenu.xib: Add a --- English.lproj/MainMenu.xib | 53 ++++++++++++++++++++++++----- MacGDBp.xcodeproj/project.pbxproj | 6 ++++ Source/AppDelegate.h | 3 ++ Source/AppDelegate.m | 8 +++++ Source/BreakpointWindowController.h | 25 ++++++++++++++ Source/BreakpointWindowController.m | 22 ++++++++++++ 6 files changed, 108 insertions(+), 9 deletions(-) create mode 100644 Source/BreakpointWindowController.h create mode 100644 Source/BreakpointWindowController.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 98c044c..1884d6e 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -2,13 +2,13 @@ 1050 - 9C7010 - 644 - 949.26 + 9D34 + 667 + 949.33 352.00 YES - + YES @@ -575,6 +575,15 @@ + + + Breakpoints + B + 1048576 + 2147483647 + + + YES @@ -858,6 +867,14 @@ 267 + + + showBreakpointWindow: + + + + 269 + @@ -914,8 +931,9 @@ - + + @@ -1338,6 +1356,11 @@ + + 268 + + + @@ -1452,6 +1475,7 @@ 263.IBPluginDependency 264.IBPluginDependency 265.IBPluginDependency + 268.IBPluginDependency 29.IBEditorWindowLastContentRect 29.IBPluginDependency 29.ImportedFromIB2 @@ -1556,7 +1580,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{248, 642}, {211, 103}} + {{248, 622}, {211, 123}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1577,6 +1601,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{63, 745}, {317, 20}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1613,7 +1638,7 @@ - 267 + 269 @@ -1622,8 +1647,17 @@ AppDelegate NSObject - showDebuggerWindow: - id + YES + + YES + showBreakpointWindow: + showDebuggerWindow: + + + YES + id + id + IBProjectSource @@ -1640,6 +1674,7 @@ FirstResponder + NSObject IBUserSource diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 6008d5f..82a3398 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 1EEBFD120D359A9F008F835B /* dimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EEBFD110D359A9F008F835B /* dimple.png */; }; 1EEE875D0D9DE4B4009CBA7C /* MacGDBp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1EEE875C0D9DE4B4009CBA7C /* MacGDBp.icns */; }; 1EEEE9400C618B70000C0732 /* SocketWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEEE93F0C618B70000C0732 /* SocketWrapper.m */; }; + 1EFF70C30DFDC018006B9D33 /* BreakpointWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EFF70C20DFDC018006B9D33 /* BreakpointWindowController.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; @@ -72,6 +73,8 @@ 1EEE875C0D9DE4B4009CBA7C /* MacGDBp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = MacGDBp.icns; path = Icons/MacGDBp.icns; sourceTree = ""; }; 1EEEE93E0C618B70000C0732 /* SocketWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketWrapper.h; path = Source/SocketWrapper.h; sourceTree = ""; }; 1EEEE93F0C618B70000C0732 /* SocketWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SocketWrapper.m; path = Source/SocketWrapper.m; sourceTree = ""; }; + 1EFF70C10DFDC018006B9D33 /* BreakpointWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointWindowController.h; path = Source/BreakpointWindowController.h; sourceTree = ""; }; + 1EFF70C20DFDC018006B9D33 /* BreakpointWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BreakpointWindowController.m; path = Source/BreakpointWindowController.m; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; @@ -149,6 +152,8 @@ 1E822CDC0DA28AC30027A23F /* Breakpoint.m */, 1E4C7AF70DA401C7000A9DC7 /* BreakpointManager.h */, 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */, + 1EFF70C10DFDC018006B9D33 /* BreakpointWindowController.h */, + 1EFF70C20DFDC018006B9D33 /* BreakpointWindowController.m */, ); name = Breakpoints; sourceTree = ""; @@ -332,6 +337,7 @@ 1E71886A0D839F6300969277 /* BSSourceViewTextView.m in Sources */, 1E822CDD0DA28AC30027A23F /* Breakpoint.m in Sources */, 1E4C7AF90DA401C7000A9DC7 /* BreakpointManager.m in Sources */, + 1EFF70C30DFDC018006B9D33 /* BreakpointWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/AppDelegate.h b/Source/AppDelegate.h index 7ed417c..7b39d47 100644 --- a/Source/AppDelegate.h +++ b/Source/AppDelegate.h @@ -16,12 +16,15 @@ #import #import "DebuggerWindowController.h" +#import "BreakpointWindowController.h" @interface AppDelegate : NSObject { DebuggerWindowController *debugger; + BreakpointWindowController *breakpoint; } - (IBAction)showDebuggerWindow:(id)sender; +- (IBAction)showBreakpointWindow:(id)sender; @end diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 114182e..7916bd1 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -47,4 +47,12 @@ [[debugger window] makeKeyAndOrderFront:self]; } +/** + * Shows the breakpoints window + */ +- (IBAction)showBreakpointWindow:(id)sender +{ + [[breakpoint window] makeKeyAndOrderFront:self]; +} + @end diff --git a/Source/BreakpointWindowController.h b/Source/BreakpointWindowController.h new file mode 100644 index 0000000..7837bb8 --- /dev/null +++ b/Source/BreakpointWindowController.h @@ -0,0 +1,25 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2008, Blue Static + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program; if not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#import + + +@interface BreakpointWindowController : NSWindowController +{ + +} + +@end diff --git a/Source/BreakpointWindowController.m b/Source/BreakpointWindowController.m new file mode 100644 index 0000000..8aa816a --- /dev/null +++ b/Source/BreakpointWindowController.m @@ -0,0 +1,22 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2008, Blue Static + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program; if not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#import "BreakpointWindowController.h" + + +@implementation BreakpointWindowController + +@end -- 2.22.5 From c3ea0e73ce49bd8f6a0000783b0f56ad9db5a60d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jun 2008 15:55:03 -0400 Subject: [PATCH 12/16] We need an instance of BreakpointWindowController in AppDelegate * Source/AppDelegate.m: (applicationDidFinishLaunching:): Init BreakpointWindowController to breakpoints * Source/BreakpointWindowController.m: (init): Add an init method --- Source/AppDelegate.m | 1 + Source/BreakpointWindowController.m | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 7916bd1..c882418 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -37,6 +37,7 @@ { // TODO: use preference values debugger = [[DebuggerWindowController alloc] initWithPort:9000 session:@"macgdbp"]; + breakpoint = [[BreakpointWindowController alloc] init]; } /** diff --git a/Source/BreakpointWindowController.m b/Source/BreakpointWindowController.m index 8aa816a..13655a0 100644 --- a/Source/BreakpointWindowController.m +++ b/Source/BreakpointWindowController.m @@ -19,4 +19,12 @@ @implementation BreakpointWindowController +- (id)init +{ + if (self = [super initWithWindowNibName:@"Breakpoints"]) + { + } + return self; +} + @end -- 2.22.5 From a31b4a460baff7077fb77f4d680c362acbdc75fc Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jun 2008 16:35:40 -0400 Subject: [PATCH 13/16] Finishing hooking up the XIB * English.lproj/Breakpoints.xib: Set File's Owner to be BreakpointWindowController and set the window IBO * Source/BreakpointWindowController.m: (init): Adding a comment --- English.lproj/Breakpoints.xib | 24 ++++++++++++++++++++---- Source/BreakpointWindowController.m | 3 +++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index 52850c3..4fe53be 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -8,7 +8,7 @@ 352.00 YES - + YES @@ -18,7 +18,7 @@ YES - NSObject + BreakpointWindowController FirstResponder @@ -339,6 +339,14 @@ YES + + + window + + + + 25 + @@ -568,7 +576,7 @@ {{398, 290}, {574, 484}} com.apple.InterfaceBuilder.CocoaPlugin {{398, 290}, {574, 484}} - + {196, 240} {{202, 428}, {480, 270}} com.apple.InterfaceBuilder.CocoaPlugin @@ -613,7 +621,7 @@ - 24 + 25 @@ -638,6 +646,14 @@ Source/BSSplitView.h + + BreakpointWindowController + NSWindowController + + IBProjectSource + Source/BreakpointWindowController.h + + NSObject diff --git a/Source/BreakpointWindowController.m b/Source/BreakpointWindowController.m index 13655a0..796b3f9 100644 --- a/Source/BreakpointWindowController.m +++ b/Source/BreakpointWindowController.m @@ -19,6 +19,9 @@ @implementation BreakpointWindowController +/** + * Constructor + */ - (id)init { if (self = [super initWithWindowNibName:@"Breakpoints"]) -- 2.22.5 From 86cff5ecda3ca39d1af82677c095ac736518966a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jun 2008 16:40:30 -0400 Subject: [PATCH 14/16] Fixing some UI quirks in the breakpoints window * English.lproj/Breakpoints.xib --- English.lproj/Breakpoints.xib | 58 ++++++----------------------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index 4fe53be..817ff76 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -8,7 +8,7 @@ 352.00 YES - + YES @@ -31,7 +31,7 @@ 2 {{196, 25}, {574, 484}} 536870912 - Window + Breakpoints NSWindow {3.40282e+38, 3.40282e+38} @@ -47,7 +47,7 @@ YES - 256 + 274 {574, 217} BSSourceView @@ -59,7 +59,7 @@ YES - 268 + 274 YES @@ -252,7 +252,7 @@ - 268 + 292 {{0, -2}, {24, 23}} YES @@ -264,7 +264,7 @@ -2033434369 162 - + NSImage NSAddTemplate @@ -274,31 +274,10 @@ 75 - - - 268 - {{-1, -2}, {24, 23}} - - YES - - -2080244224 - 134217728 - - - - -2033434369 - 162 - - - - 400 - 75 - - - 268 - {{22, -2}, {24, 23}} + 292 + {{23, -2}, {26, 23}} YES @@ -420,7 +399,6 @@ YES - @@ -504,20 +482,6 @@ - - 21 - - - YES - - - - - - 22 - - - 23 @@ -559,8 +523,6 @@ 19.IBPluginDependency 2.IBPluginDependency 20.IBPluginDependency - 21.IBPluginDependency - 22.IBPluginDependency 23.IBPluginDependency 24.IBPluginDependency 3.CustomClassName @@ -576,7 +538,7 @@ {{398, 290}, {574, 484}} com.apple.InterfaceBuilder.CocoaPlugin {{398, 290}, {574, 484}} - + {196, 240} {{202, 428}, {480, 270}} com.apple.InterfaceBuilder.CocoaPlugin @@ -593,8 +555,6 @@ 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 -- 2.22.5 From ee5cd7b632c60919d7aedfa8ea5af1923fdb6c26 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 10 Jun 2008 11:30:11 -0400 Subject: [PATCH 15/16] Add an ivar for the BreakpointManager in the BreakpointWindowController * Source/BreakpointWindowController.h: Add the ivar manager * Source/BreakpointWindowController.m: (init:): Set the ivar to the sharedManager --- Source/BreakpointWindowController.h | 4 ++-- Source/BreakpointWindowController.m | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/BreakpointWindowController.h b/Source/BreakpointWindowController.h index 7837bb8..c800730 100644 --- a/Source/BreakpointWindowController.h +++ b/Source/BreakpointWindowController.h @@ -15,11 +15,11 @@ */ #import - +#import "BreakpointManager.h" @interface BreakpointWindowController : NSWindowController { - + BreakpointManager *manager; } @end diff --git a/Source/BreakpointWindowController.m b/Source/BreakpointWindowController.m index 796b3f9..74c09be 100644 --- a/Source/BreakpointWindowController.m +++ b/Source/BreakpointWindowController.m @@ -26,6 +26,7 @@ { if (self = [super initWithWindowNibName:@"Breakpoints"]) { + manager = [BreakpointManager sharedManager]; } return self; } -- 2.22.5 From 95dd118190cd2c16cbe7bcbd25a1bdb42977ede3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 10 Jun 2008 11:58:11 -0400 Subject: [PATCH 16/16] Rewrite BreakpointManager to use NSArray instead a faux hashtable using a NSDictionary * Source/Breakpoint.m+h --- Source/BreakpointManager.h | 5 ++-- Source/BreakpointManager.m | 54 ++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Source/BreakpointManager.h b/Source/BreakpointManager.h index da8cc03..33f94cf 100644 --- a/Source/BreakpointManager.h +++ b/Source/BreakpointManager.h @@ -19,13 +19,14 @@ @interface BreakpointManager : NSObject { - NSMutableDictionary *breakpoints; + NSMutableArray *breakpoints; } + (BreakpointManager *)sharedManager; +- (NSArray *)breakpoints; - (void)addBreakpoint:(Breakpoint *)bp; - (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file; -- (NSSet *)breakpointsForFile:(NSString *)file; +- (NSArray *)breakpointsForFile:(NSString *)file; - (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file; @end diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index b1a1f16..1931a09 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -27,7 +27,7 @@ { if (!breakpoints) { - breakpoints = [[NSMutableDictionary alloc] init]; + breakpoints = [[NSMutableArray alloc] init]; } } return self; @@ -46,20 +46,22 @@ return manager; } +/** + * Returns an array of all the breakpoints + */ +- (NSArray *)breakpoints +{ + return breakpoints; +} + /** * Registers a breakpoint at a given line */ - (void)addBreakpoint:(Breakpoint *)bp; { - NSMutableSet *lines = [breakpoints valueForKey:[bp file]]; - if (lines == nil) + if (![breakpoints containsObject:bp]) { - lines = [NSMutableSet setWithObject:bp]; - [breakpoints setValue:lines forKey:[bp file]]; - } - else - { - [lines addObject:bp]; + [breakpoints addObject:bp]; } } @@ -68,12 +70,11 @@ */ - (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file { - NSMutableSet *lines = [breakpoints valueForKey:file]; - for (Breakpoint *b in lines) + for (Breakpoint *b in breakpoints) { - if ([b line] == line) + if ([b line] == line && [[b file] isEqualToString:file]) { - [lines removeObject:b]; + [breakpoints removeObject:b]; return b; } } @@ -83,9 +84,18 @@ /** * Returns all the breakpoints for a given file */ -- (NSSet *)breakpointsForFile:(NSString *)file +- (NSArray *)breakpointsForFile:(NSString *)file { - return [breakpoints valueForKey:file]; + NSMutableArray *matches = [NSMutableArray array]; + for (Breakpoint *b in breakpoints) + { + if ([[b file] isEqualToString:file]) + { + [matches addObject:b]; + } + } + + return matches; } /** @@ -93,19 +103,7 @@ */ - (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file { - NSSet *lines = [breakpoints valueForKey:file]; - if (!lines) - { - return NO; - } - for (Breakpoint *b in lines) - { - if ([b line] == line) - { - return YES; - } - } - return NO; + return [breakpoints containsObject:[[Breakpoint alloc] initWithLine:line inFile:file]]; } @end -- 2.22.5