start the debugger only if it was never started, else, reuse it

This commit is contained in:
Riccardo Mottola 2021-07-09 01:18:20 +02:00
parent ec805871c3
commit dd1c1e75ba
3 changed files with 9 additions and 1 deletions

View file

@ -91,6 +91,11 @@
} }
} }
- (BOOL)debuggerStarted
{
return debuggerStarted;
}
- (void)setFont:(NSFont *)aFont - (void)setFont:(NSFont *)aFont
{ {
if (font != aFont) if (font != aFont)

View file

@ -179,7 +179,8 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
- (void) show - (void) show
{ {
[debuggerWindow makeKeyAndOrderFront: self]; [debuggerWindow makeKeyAndOrderFront: self];
[self startDebugger]; if (![debuggerWrapper debuggerStarted])
[self startDebugger];
} }
- (void) startDebugger - (void) startDebugger

View file

@ -42,6 +42,8 @@
- (PCDebugger *)debugger; - (PCDebugger *)debugger;
- (void)setDebugger:(PCDebugger *)dbg; - (void)setDebugger:(PCDebugger *)dbg;
- (BOOL)debuggerStarted;
- (void) runProgram: (NSString *)path - (void) runProgram: (NSString *)path
inCurrentDirectory: (NSString *)directory inCurrentDirectory: (NSString *)directory
withArguments: (NSArray *)array withArguments: (NSArray *)array