Ignore:
Timestamp:
Jan 17, 2022, 4:53:31 PM (3 years ago)
Author:
chronos
Message:
  • Added: Two more code examples.
  • Added: Allow to disable debugging support.
  • Added: Remember last opened tab in options form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r126 r128  
    334334var
    335335  Title: string;
     336  CanDebug: Boolean;
    336337begin
    337338  Title := '';
     
    352353  AProgramCompile.Enabled := (tcCompile in Core.CurrentTarget.Capabilities) and
    353354    Core.Project.Openned;
    354   AProgramStepInto.Enabled := (tcStepInto in Core.CurrentTarget.Capabilities) and
    355     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    356   AProgramStepOut.Enabled := (tcStepOut in Core.CurrentTarget.Capabilities) and
    357     Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
    358   AProgramRunToCursor.Enabled := (tcRunToCursor in Core.CurrentTarget.Capabilities) and
    359     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    360   AProgramStepOver.Enabled := (tcStepOver in Core.CurrentTarget.Capabilities) and
    361     Core.Project.Openned and ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
    362   AProgramShowExecutionPoint.Enabled := (tcPause in Core.CurrentTarget.Capabilities) and
    363     Core.Project.Openned and (Core.CurrentTarget.State = rsPaused);
     355  CanDebug := Core.DebugEnabled and Core.Project.Openned and
     356    ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped));
     357  AProgramStepInto.Enabled := CanDebug and (tcStepInto in Core.CurrentTarget.Capabilities);
     358  AProgramStepOut.Enabled := CanDebug and (tcStepOut in Core.CurrentTarget.Capabilities);
     359  AProgramRunToCursor.Enabled := CanDebug and (tcRunToCursor in Core.CurrentTarget.Capabilities);
     360  AProgramStepOver.Enabled := CanDebug and (tcStepOver in Core.CurrentTarget.Capabilities);
     361  AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in Core.CurrentTarget.Capabilities);
    364362  AShowSourcePosition.Enabled := Core.CurrentTarget.Compiled;
    365363  AShowTargetPosition.Enabled := Core.CurrentTarget.Compiled;
     
    568566  if Core.CurrentTarget.State = rsStopped then begin
    569567    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
    570     Core.CurrentTarget.BreakPoints.SetSystem(TDebugStep(Core.CurrentTarget.DebugSteps.First).ProgramPosition);
     568    Core.CurrentTarget.BreakPoints.SetSystem(Core.CurrentTarget.DebugSteps.First.ProgramPosition);
    571569    AProgramRun.Execute;
    572570  end else Core.CurrentTarget.StepInto;
Note: See TracChangeset for help on using the changeset viewer.