projectRegenerateItem.disabled = !projectView;
projectCompileItem.disabled = !projectView;
+ /* What is this? This completely ignore the debugger's state!
debugStartResumeItem.disabled = !projectView; // && project.targetType == executable);
debugRestartItem.disabled = true;
debugBreakItem.disabled = true;
debugSkipStepOverItem.disabled = true;
debugSkipStepOutItem.disabled = true;
debugSkipRunToCursorItem.disabled = true;
+ */
+ DebugUpdateMenus(ide.debugger.state, false);
viewProjectItem.disabled = !projectView;
}
{
DirExpression targetDir = prj.targetDir;
- if(buildType != run/* && prj == project*/ && prj.configIsInDebugSession)
- DebugStop();
+ // TOFIX: DebugStop is being abused and backfiring on us.
+ // It's supposed to be the 'Debug/Stop' item, not unloading executable or anything else
+
+ // configIsInDebugSession seems to be used for two OPPOSITE things:
+ // If we're debugging another config, we need to unload the executable!
+ // In building, we want to stop if we're debugging the 'same' executable
+ if(buildType != run) ///* && prj == project*/ && prj.configIsInDebugSession)
+ {
+ if(buildType == debug)
+ {
+ if(ide.debugger && ide.debugger.isPrepared)
+ {
+ DebugStop();
+ }
+ }
+ else
+ {
+ if(ide.project == prj && ide.debugger && ide.debugger.prjConfig == prj.config && ide.debugger.isPrepared)
+ {
+ DebugStop();
+ }
+ }
+ }
// TODO: Disabled until problems fixed... is it fixed?
if(buildType == rebuild || (prj.config && prj.config.compilingModified))