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 */; };
+ 1E3F9D941CBAB57B005D896B /* PreferenceNames.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E3F9D931CBAB57B005D896B /* PreferenceNames.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 */; };
1E4C7AF90DA401C7000A9DC7 /* BreakpointManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */; };
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>"; };
+ 1E3F9D931CBAB57B005D896B /* PreferenceNames.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferenceNames.m; path = Source/PreferenceNames.m; sourceTree = "<group>"; };
+ 1E3F9D951CBAB589005D896B /* PreferenceNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PreferenceNames.h; path = Source/PreferenceNames.h; sourceTree = "<group>"; };
1E416FF70D36F821009A53A2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
1E42F1D60F53317B008412DB /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
1E4C7AF70DA401C7000A9DC7 /* BreakpointManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointManager.h; path = Source/BreakpointManager.h; sourceTree = "<group>"; };
1E9582640E252480001A3D89 /* Preferences */ = {
isa = PBXGroup;
children = (
+ 1E3F9D951CBAB589005D896B /* PreferenceNames.h */,
+ 1E3F9D931CBAB57B005D896B /* PreferenceNames.m */,
1E9582650E2524AD001A3D89 /* PreferencesController.h */,
1E9582660E2524AD001A3D89 /* PreferencesController.m */,
1E67E6FB0F3C052000E68F1B /* PreferencesPathsArrayController.h */,
1E02C5710C610158006F1752 /* DebuggerBackEnd.m in Sources */,
1E02C5F60C610724006F1752 /* DebuggerController.m in Sources */,
1E35FC760C6579CA0030F527 /* NSXMLElementAdditions.m in Sources */,
+ 1E3F9D941CBAB57B005D896B /* PreferenceNames.m in Sources */,
1E7188690D839F6300969277 /* BSSourceView.mm in Sources */,
1E822CDD0DA28AC30027A23F /* Breakpoint.m in Sources */,
1E4C7AF90DA401C7000A9DC7 /* BreakpointManager.m in Sources */,
#import <Sparkle/Sparkle.h>
+#import "PreferenceNames.h"
+
@implementation AppDelegate
@synthesize debugger;
{
@autoreleasepool {
NSDictionary* defaults = @{
- @"Port" : @9000,
- @"BreakpointsWindowVisible" : @YES,
- @"InspectorWindowVisible" : @YES,
- @"PathReplacements" : [NSMutableArray array],
- @"BreakOnFirstLine" : @YES,
- @"DebuggerAttached" : @YES
+ kPrefPort : @9000,
+ kPrefBreakpointsWindowVisible : @YES,
+ kPrefInspectorWindowVisible : @YES,
+ kPrefPathReplacements : [NSMutableArray array],
+ kPrefBreakOnFirstLine : @YES,
+ kPrefDebuggerAttached : @YES
};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}
// Record whether this user ever used the beta VersionCast feed. In the
// future, we will use this bit to query for unstable releases after the user
// has upgraded to a stable version.
- NSString* const kUsesUnstableVersionCast = @"UnstableVersionCast";
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- BOOL usesUnstable = [defaults boolForKey:kUsesUnstableVersionCast];
+ BOOL usesUnstable = [defaults boolForKey:kPrefUnstableVersionCast];
NSURL* feedURL = [[SUUpdater sharedUpdater] feedURL];
usesUnstable = usesUnstable ||
[[feedURL absoluteString] rangeOfString:@"?unstable"].location != NSNotFound;
- [defaults setBool:usesUnstable forKey:kUsesUnstableVersionCast];
+ [defaults setBool:usesUnstable forKey:kPrefUnstableVersionCast];
}
- (void)applicationWillTerminate:(NSNotification*)notification
{
[[NSUserDefaults standardUserDefaults] setBool:self.debugger.connection.autoAttach
- forKey:@"DebuggerAttached"];
+ forKey:kPrefDebuggerAttached];
}
/**
#import "Breakpoint.h"
+#import "PreferenceNames.h"
@implementation Breakpoint
{
NSString* path = self.file;
- NSMutableArray* transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"];
+ NSMutableArray* transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:kPrefPathReplacements];
if (!transforms || [transforms count] < 1)
return path;
#import "BreakpointController.h"
#import "AppDelegate.h"
+#import "PreferenceNames.h"
@implementation BreakpointController
if (self = [super initWithWindowNibName:@"Breakpoints"])
{
manager = [BreakpointManager sharedManager];
- if ([[NSUserDefaults standardUserDefaults] boolForKey:@"BreakpointsWindowVisible"])
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:kPrefBreakpointsWindowVisible])
[[self window] orderBack:nil];
}
return self;
*/
#import "BreakpointManager.h"
+
#import "AppDelegate.h"
+#import "PreferenceNames.h"
@interface BreakpointManager (Private)
- (void)updateDisplaysForFile:(NSString*)file;
breakpoints = [[NSMutableArray alloc] init];
}
- savedBreakpoints = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"Breakpoints"] mutableCopy];
+ savedBreakpoints = [[[NSUserDefaults standardUserDefaults] arrayForKey:kPrefBreakpoints] mutableCopy];
if (savedBreakpoints)
{
for (NSDictionary* d in savedBreakpoints)
[connection addBreakpoint:bp];
[savedBreakpoints addObject:[bp dictionary]];
- [[NSUserDefaults standardUserDefaults] setObject:savedBreakpoints forKey:@"Breakpoints"];
+ [[NSUserDefaults standardUserDefaults] setObject:savedBreakpoints forKey:kPrefBreakpoints];
[self updateDisplaysForFile:[bp file]];
}
[connection removeBreakpoint:b];
[savedBreakpoints removeObject:[b dictionary]];
- [[NSUserDefaults standardUserDefaults] setObject:savedBreakpoints forKey:@"Breakpoints"];
+ [[NSUserDefaults standardUserDefaults] setObject:savedBreakpoints forKey:kPrefBreakpoints];
[self updateDisplaysForFile:file];
return b;
#import "DebuggerBackEnd.h"
#import "DebuggerModel.h"
#import "EvalController.h"
+#import "PreferenceNames.h"
#import "NSXMLElementAdditions.h"
#import "StackFrame.h"
options:NSKeyValueObservingOptionNew
context:nil];
- connection = [[DebuggerBackEnd alloc] initWithPort:[defaults integerForKey:@"Port"]
- autoAttach:[defaults boolForKey:@"DebuggerAttached"]];
+ connection = [[DebuggerBackEnd alloc] initWithPort:[defaults integerForKey:kPrefPort]
+ autoAttach:[defaults boolForKey:kPrefDebuggerAttached]];
connection.model = _model;
expandedVariables = [[NSMutableSet alloc] init];
[[self window] makeKeyAndOrderFront:nil];
[[self window] setDelegate:self];
- if ([defaults boolForKey:@"InspectorWindowVisible"])
+ if ([defaults boolForKey:kPrefInspectorWindowVisible])
[inspector orderFront:self];
}
return self;
[errormsg setHidden:YES];
if (!self.connection.autoAttach)
return;
- if ([[NSUserDefaults standardUserDefaults] boolForKey:@"BreakOnFirstLine"])
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:kPrefBreakOnFirstLine])
[self stepIn:self];
// Do not cache the file between debugger executions.
sourceViewer.file = nil;
--- /dev/null
+/*
+ * MacGDBp
+ * Copyright (c) 2016, Blue Static <https://www.bluestatic.org>
+ *
+ * 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
+ */
+
+@class NSString;
+
+// NSNumber integer for the port to listen on.
+extern NSString* const kPrefPort;
+
+// NSNumber bool for whether the breakpoints window is visible.
+extern NSString* const kPrefBreakpointsWindowVisible;
+
+// NSNumber bool for whether the inspector window is visible.
+extern NSString* const kPrefInspectorWindowVisible;
+
+// NSMutableArray of path replacements.
+extern NSString* const kPrefPathReplacements;
+
+// NSNumber bool for whether to stop the debugger on the first line of the
+// program.
+extern NSString* const kPrefBreakOnFirstLine;
+
+// NSNumber bool for whether the debugger is currently listening/attached.
+extern NSString* const kPrefDebuggerAttached;
+
+// NSNumber bool for whether the app ever reported as an unstable version in
+// update checks. This will let the user download future unstable versions.
+extern NSString* const kPrefUnstableVersionCast;
+
+// NSMutableArray of breakpoints.
+extern NSString* const kPrefBreakpoints;
--- /dev/null
+/*
+ * MacGDBp
+ * Copyright (c) 2016, Blue Static <https://www.bluestatic.org>
+ *
+ * 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 <Foundation/Foundation.h>
+
+NSString* const kPrefPort = @"Port";
+
+NSString* const kPrefBreakpointsWindowVisible = @"BreakpointsWindowVisible";
+
+NSString* const kPrefInspectorWindowVisible = @"InspectorWindowVisible";
+
+NSString* const kPrefPathReplacements = @"PathReplacements";
+
+NSString* const kPrefBreakOnFirstLine = @"BreakOnFirstLine";
+
+NSString* const kPrefDebuggerAttached = @"DebuggerAttached";
+
+NSString* const kPrefUnstableVersionCast = @"UnstableVersionCast";
+
+NSString* const kPrefBreakpoints = @"Breakpoints";