From ec805871c3c616ac6afe47a1b6384b1cef4489e5 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 9 Jul 2021 01:03:33 +0200 Subject: [PATCH] If we already instantiated a Debugger, reuse it. --- ChangeLog | 5 +++++ Framework/PCProjectLauncher.m | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc2f6f1..56a7a4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-07-09 Riccardo Mottola + + * Framework/PCProjectLauncher.m + If we already instantiated a Debugger, reuse it. + 2021-07-06 Riccardo Mottola * Modules/Debuggers/ProjectCenter/PCDebugger.h diff --git a/Framework/PCProjectLauncher.m b/Framework/PCProjectLauncher.m index 467e8b4..d5e00e1 100644 --- a/Framework/PCProjectLauncher.m +++ b/Framework/PCProjectLauncher.m @@ -293,12 +293,20 @@ enum { // Debugger - debugger = [bundleManager objectForBundleType: @"debugger" - protocol: @protocol(CodeDebugger) - fileName: [executablePath stringByDeletingLastPathComponent]]; - [debugger debugExecutableAtPath: executablePath - withDebugger: gdbPath]; - if (!debugger) + if (nil == debugger) + { + debugger = [bundleManager objectForBundleType: @"debugger" + protocol: @protocol(CodeDebugger) + fileName: [executablePath stringByDeletingLastPathComponent]]; + [debugger debugExecutableAtPath: executablePath + withDebugger: gdbPath]; + } + else + { + [debugger show]; + } + + if (nil == debugger) NSLog(@"No debugger module found"); // turn debug button off...