Ignore:
Timestamp:
May 17, 2019, 10:32:20 PM (6 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r108 r113  
    418418  DebugStep: TDebugStep;
    419419begin
    420   DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.SynEditTarget.SelStart);
     420  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.SynEditTarget.SelStart - 1);
    421421  if Assigned(DebugStep) then begin
    422     FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition;
     422    FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1;
    423423    PageControlMain.TabIndex := 0;
    424424  end;
     
    429429  DebugStep: TDebugStep;
    430430begin
    431   DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart);
     431  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);
    432432  if Assigned(DebugStep) then begin
    433     FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition;
     433    FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1;
    434434    PageControlMain.TabIndex := 1;
    435435  end;
     
    521521  BreakPoint: TBreakPoint;
    522522begin
    523   DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart);
     523  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);
    524524  if Assigned(DebugStep) then begin
    525525    BreakPoint := Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition);
     
    554554  if Core.CurrentTarget.State = rsStopped then begin
    555555    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
    556     DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart);
     556    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);
    557557    Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition);
    558558    AProgramRun.Execute;
    559559  end else begin
    560     DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart);
     560    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);
    561561    Core.CurrentTarget.RunToCursor(DebugStep.TargetPosition);
    562562  end;
     
    568568begin
    569569  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(Core.CurrentTarget.ExecutionPosition);
    570   FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition;
    571   FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition;
     570  FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1;
     571  FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1;
    572572  if PageControlMain.TabIndex = 0 then FormSourceCode.SynEditSource.SetFocus;
    573573  if PageControlMain.TabIndex = 1 then FormTargetCode.SynEditTarget.SetFocus;
Note: See TracChangeset for help on using the changeset viewer.