Changeset 175 for trunk


Ignore:
Timestamp:
Aug 21, 2024, 10:00:57 AM (4 months ago)
Author:
chronos
Message:
  • Fixed: Error on showing execution point in not paused state.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormMain.pas

    r173 r175  
    374374    AProgramRunToCursor.Enabled := CanDebug and (tcRunToCursor in CurrentTarget.Capabilities);
    375375    AProgramStepOver.Enabled := CanDebug and (tcStepOver in CurrentTarget.Capabilities);
    376     AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in CurrentTarget.Capabilities);
     376    AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in CurrentTarget.Capabilities) and
     377      (CurrentTarget.State = rsPaused);
    377378    AShowSourcePosition.Enabled := CurrentTarget.Compiled;
    378379    AShowTargetPosition.Enabled := CurrentTarget.Compiled;
     
    689690  DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchByProgramPos(
    690691    Core.Core.CurrentTarget.ExecutionPosition);
    691   FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1;
    692   FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1;
    693   if PageControlMain.TabIndex = 0 then FormSourceCode.SynEditSource.SetFocus;
    694   if PageControlMain.TabIndex = 1 then FormTargetCode.SynEditTarget.SetFocus;
     692  if Assigned(DebugStep) then begin
     693    FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1;
     694    FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1;
     695    if PageControlMain.TabIndex = 0 then FormSourceCode.SynEditSource.SetFocus;
     696    if PageControlMain.TabIndex = 1 then FormTargetCode.SynEditTarget.SetFocus;
     697  end;
    695698end;
    696699
Note: See TracChangeset for help on using the changeset viewer.