Ignore:
Timestamp:
Oct 11, 2015, 6:28:24 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Used jump instructions parameter instead of special sourcejump auxiliary array.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTargetInterpretter.pas

    r66 r68  
    5555  public
    5656    FProgramBreakpoints: array of Boolean;
    57     SourceJump: array of Integer;
    5857    SourceBreakpoint: array of Boolean;
    5958    Memory: array of Integer;
     
    176175  I: Integer;
    177176begin
    178   SetLength(SourceJump, Length(FProgram));
    179   //FillChar(Pointer(SourceJump)^, Length(SourceJump), 0);
    180   for I := 0 to Length(FProgram) - 1 do
    181     SourceJump[I] := 0;
    182177  SetLength(Loop, 0);
    183178  for I := 0 to Length(FProgram) - 1 do begin
     
    188183      end;
    189184      cmLoopEnd: begin
    190         if SourceJump[I] > 0 then raise Exception.Create(SJumpTableColision);
    191         SourceJump[I] := Loop[High(Loop)];
    192         if SourceJump[Loop[High(Loop)]] > 0 then raise Exception.Create(SJumpTableColision);
    193         SourceJump[Loop[High(Loop)]] := I;
     185        if FProgram[I].Parameter > 0 then
     186          raise Exception.Create(SJumpTableColision);
     187        FProgram[I].Parameter := Loop[High(Loop)];
     188        if FProgram[Loop[High(Loop)]].Parameter > 0 then
     189          raise Exception.Create(SJumpTableColision);
     190        FProgram[Loop[High(Loop)]].Parameter := I;
    194191        SetLength(Loop, Length(Loop) - 1);
    195192      end;
     
    221218begin
    222219  if Memory[MemoryPosition] = 0 then
    223     FProgramIndex := SourceJump[FProgramIndex];
     220    FProgramIndex := FProgram[FProgramIndex].Parameter;
    224221end;
    225222
     
    227224begin
    228225  if Memory[MemoryPosition] > 0 then
    229     FProgramIndex := SourceJump[FProgramIndex] - 1;
     226    FProgramIndex := FProgram[FProgramIndex].Parameter - 1;
    230227end;
    231228
     
    347344    if Step.Operation = soStepOut then begin
    348345      BreakPoints.SetSystem(Step.TargetPosition + 1);
    349       Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]);
     346      Step := DebugSteps.SearchByTargetPos(FProgram[Step.TargetPosition].Parameter);
    350347      BreakPoints.AddSystem(Step.TargetPosition);
    351348    end else
    352349    if Step.Operation = soStepIn then begin
    353350      BreakPoints.SetSystem(Step.TargetPosition + 1);
    354       Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]);
     351      Step := DebugSteps.SearchByTargetPos(FProgram[Step.TargetPosition].Parameter);
    355352      BreakPoints.AddSystem(Step.TargetPosition);
    356353    end else BreakPoints.SetSystem(Step.TargetPosition + 1);
     
    369366    if Step.Operation = soStepOut then begin
    370367      BreakPoints.SetSystem(Step.TargetPosition + 1);
    371       Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]);
     368      Step := DebugSteps.SearchByTargetPos(FProgram[Step.TargetPosition].Parameter);
    372369      BreakPoints.AddSystem(Step.TargetPosition);
    373370    end else
    374371    if Step.Operation = soStepIn then begin
    375       Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]);
     372      Step := DebugSteps.SearchByTargetPos(FProgram[Step.TargetPosition].Parameter);
    376373      BreakPoints.SetSystem(Step.TargetPosition + 1);
    377374    end else BreakPoints.SetSystem(Step.TargetPosition + 1);
Note: See TracChangeset for help on using the changeset viewer.