Changeset 114 for trunk/Target/UTargetInterpretter.pas
- Timestamp:
- May 18, 2019, 12:13:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/UTargetInterpretter.pas
r112 r114 76 76 end; 77 77 78 const79 BrainFuckCommandText: array[TMachineCommand] of Char = (80 ' ', '+', '-', '>', '<', '.', ',', '[', ']', '@', '=', '*');81 82 78 83 79 implementation … … 321 317 Result := ''; 322 318 for I := 0 to Length(FProgram) - 1 do begin 323 Result := Result + BrainFuckCommandText[FProgram[I].Command]; 324 if FProgram[I].Command in [cmInc, cmDec, cmPointerInc, cmPointerDec, 325 cmSet, cmMultipy] then begin 326 if FProgram[I].Parameter <> 1 then 327 Result := Result + IntToStr(FProgram[I].Parameter); 328 end; 329 if FProgram[I].RelIndex <> 0 then 330 Result := Result + 'R' + IntToStr(FProgram[I].RelIndex); 319 Result := Result + GetOperationText(FProgram[I]); 331 320 end; 332 321 end; … … 369 358 begin 370 359 if State = rsPaused then begin 371 Step := DebugSteps.SearchBy TargetPos(FProgramIndex);360 Step := DebugSteps.SearchByProgramPos(FProgramIndex); 372 361 if Step.Operation = soStepOut then begin 373 BreakPoints.SetSystem(Step. TargetPosition + 1);374 Step := DebugSteps.SearchBy TargetPos(FProgram[Step.TargetPosition].Parameter);375 BreakPoints.AddSystem(Step. TargetPosition);362 BreakPoints.SetSystem(Step.ProgramPosition + 1); 363 Step := DebugSteps.SearchByProgramPos(FProgram[Step.ProgramPosition].Parameter); 364 BreakPoints.AddSystem(Step.ProgramPosition); 376 365 end else 377 366 if Step.Operation = soStepIn then begin 378 BreakPoints.SetSystem(Step. TargetPosition + 1);379 Step := DebugSteps.SearchBy TargetPos(FProgram[Step.TargetPosition].Parameter);380 BreakPoints.AddSystem(Step. TargetPosition);381 end else BreakPoints.SetSystem(Step. TargetPosition + 1);367 BreakPoints.SetSystem(Step.ProgramPosition + 1); 368 Step := DebugSteps.SearchByProgramPos(FProgram[Step.ProgramPosition].Parameter); 369 BreakPoints.AddSystem(Step.ProgramPosition); 370 end else BreakPoints.SetSystem(Step.ProgramPosition + 1); 382 371 Run; 383 372 end else raise Exception.Create(SProgramNotRunning); … … 389 378 begin 390 379 if State = rsPaused then begin 391 Step := DebugSteps.SearchBy TargetPos(FProgramIndex);380 Step := DebugSteps.SearchByProgramPos(FProgramIndex); 392 381 if Step.Operation = soStepOut then begin 393 BreakPoints.SetSystem(Step. TargetPosition + 1);394 Step := DebugSteps.SearchBy TargetPos(FProgram[Step.TargetPosition].Parameter);395 BreakPoints.AddSystem(Step. TargetPosition);382 BreakPoints.SetSystem(Step.ProgramPosition + 1); 383 Step := DebugSteps.SearchByProgramPos(FProgram[Step.ProgramPosition].Parameter); 384 BreakPoints.AddSystem(Step.ProgramPosition); 396 385 end else 397 386 if Step.Operation = soStepIn then begin 398 Step := DebugSteps.SearchBy TargetPos(FProgram[Step.TargetPosition].Parameter);399 BreakPoints.SetSystem(Step. TargetPosition + 1);400 end else BreakPoints.SetSystem(Step. TargetPosition + 1);387 Step := DebugSteps.SearchByProgramPos(FProgram[Step.ProgramPosition].Parameter); 388 BreakPoints.SetSystem(Step.ProgramPosition + 1); 389 end else BreakPoints.SetSystem(Step.ProgramPosition + 1); 401 390 Run; 402 391 end else raise Exception.Create(SProgramNotRunning); … … 410 399 begin 411 400 if State = rsPaused then begin 412 Step := DebugSteps.SearchBy TargetPos(FProgramIndex);401 Step := DebugSteps.SearchByProgramPos(FProgramIndex); 413 402 StepIndex := DebugSteps.IndexOf(Step); 414 403 Nesting := 1; … … 419 408 end; 420 409 if StepIndex < DebugSteps.Count then begin 421 Breakpoints.SetSystem(TDebugStep(DebugSteps[StepIndex]). TargetPosition);410 Breakpoints.SetSystem(TDebugStep(DebugSteps[StepIndex]).ProgramPosition); 422 411 end; 423 412 Run;
Note:
See TracChangeset
for help on using the changeset viewer.