Skip to content

Commit

Permalink
ide/debugger: fixed problem where debugging a different config would …
Browse files Browse the repository at this point in the history
…still run the first config debugged, fixed Debug menus not taking into account the debugging state
  • Loading branch information
jerstlouis committed Jun 6, 2011
1 parent f34206a commit 04a442b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ide/src/ide.ec
Expand Up @@ -1462,6 +1462,7 @@ class IDE : Window
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;
Expand All @@ -1474,6 +1475,8 @@ class IDE : Window
debugSkipStepOverItem.disabled = true;
debugSkipStepOutItem.disabled = true;
debugSkipRunToCursorItem.disabled = true;
*/
DebugUpdateMenus(ide.debugger.state, false);

viewProjectItem.disabled = !projectView;
}
Expand Down
25 changes: 23 additions & 2 deletions ide/src/project/ProjectView.ec
Expand Up @@ -1273,8 +1273,29 @@ class ProjectView : Window
{
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();

This comment has been minimized.

Copy link
@ecere

ecere Jun 6, 2011

Collaborator

We should actually never go inside here... Debug menu item should be disabled if we're currently debugging.

}
}
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))
Expand Down

0 comments on commit 04a442b

Please sign in to comment.