Changeset 36
- Timestamp:
- Feb 19, 2012, 9:44:58 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.lfm
r35 r36 580 580 object MenuItem32: TMenuItem 581 581 Action = AProgramStepInto 582 Bitmap.Data = { 583 36040000424D3604000000000000360000002800000010000000100000000100 584 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 585 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 586 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 587 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 588 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 589 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 590 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 591 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 592 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 593 FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00000000FF0000 594 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 595 FF000000AB4C0000AAD10000AAFF0000AAFF0000AADB0000AA1BFFFFFF00FFFF 596 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 597 FF000000AAD10000A8380000ABA60000AB5B0000AA06FFFFFF00000000FF0000 598 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 599 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 600 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 601 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 602 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 603 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 604 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 605 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 606 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 607 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 608 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 609 FF000000AAD10000A838FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 610 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 611 FF000000AB4C0000AAD10000AAFF0000AAFF0000AAFF0000AAFF0000AAC0FFFF 612 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 613 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 614 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 615 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 616 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 617 } 582 618 end 583 619 object MenuItem33: TMenuItem 584 620 Action = AProgramStepOver 621 Bitmap.Data = { 622 36040000424D3604000000000000360000002800000010000000100000000100 623 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 624 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000ABA60000AB5B0000 625 AA06FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 626 FF000000AB4C0000AAD10000AAFF0000AAFF0000AAFF0000AAFF0000AAFF0000 627 AADB0000AA1BFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 628 FF000000AAD10000A838FFFFFF00FFFFFF00FFFFFF000000ABA60000AB5B0000 629 AA06FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 630 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 631 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 632 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 633 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 634 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 635 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 636 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 637 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 638 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 639 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 640 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 641 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 642 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 643 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 644 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 645 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 646 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 647 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 648 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 649 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 650 FF000000AAD10000A838FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 651 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 652 FF000000AB4C0000AAD10000AAFF0000AAFF0000AAFF0000AAFF0000AAC0FFFF 653 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 654 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 655 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 656 } 585 657 end 586 658 object MenuItem34: TMenuItem 587 659 Action = AProgramStepOut 660 Bitmap.Data = { 661 36040000424D3604000000000000360000002800000010000000100000000100 662 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 663 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 664 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 665 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000ABA60000AB5B0000 666 AA06FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 667 FF000000AB4C0000AAD10000AAFF0000AAFF0000AAFF0000AAFF0000AAFF0000 668 AADB0000AA1BFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 669 FF000000AAD10000A838FFFFFF00FFFFFF00FFFFFF000000ABA60000AB5B0000 670 AA06FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 671 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 672 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 673 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 674 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 675 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 676 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 677 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 678 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 679 FF000000AAFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 680 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 681 FF000000AAD10000A838FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 682 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 683 FF000000AB4C0000AAD10000AAFF0000AAFF0000AAC0FFFFFF00FFFFFF00FFFF 684 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 685 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000 686 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 687 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 688 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 689 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF0000 690 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 691 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 692 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 693 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 694 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 695 } 588 696 end 589 697 object MenuItem35: TMenuItem 590 698 Action = AProgramRunToCursor 699 Bitmap.Data = { 700 36040000424D3604000000000000360000002800000010000000100000000100 701 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 702 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 703 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 704 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7 705 D74CCCCCCCA0CCCCCCA0CCCCCCA0CCCCCCA0CCCCCCA0D7D7D74CFFFFFF00FFFF 706 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCC 707 CCA0000000FF000000FF000000FF000000FF000000FFCCCCCCA0FFFFFF000000 708 000800000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7 709 D74CCCCCCCA0BEBEBED5000000FFBEBEBED5CCCCCCA0D7D7D74CFFFFFF000000 710 0028004000DB002E007900000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 711 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 712 0028006C00FF007C00FF005100D30031007800000006FFFFFF00FFFFFF00FFFF 713 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 714 0028006C00FF008000FF008000FF007D00FF005200D30031007700000006FFFF 715 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 716 0028006C00FF008000FF008000FF008000FF008000FF007D00FF005300D20031 717 007700000006CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 718 0028006C00FF008000FF008000FF008000FF008000FF007D00FF005300D20031 719 007700000006CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 720 0028006C00FF008000FF008000FF007D00FF005200D30031007700000006FFFF 721 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 722 0028006C00FF007C00FF005100D30031007800000006FFFFFF00FFFFFF00FFFF 723 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 724 0028004000DB002E007900000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 725 FF00FFFFFF00CCCCCCA0000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000 726 000800000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7 727 D74CCCCCCCA0BEBEBED5000000FFBEBEBED5CCCCCCA0D7D7D74CFFFFFF00FFFF 728 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCC 729 CCA0000000FF000000FF000000FF000000FF000000FFCCCCCCA0FFFFFF00FFFF 730 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7 731 D74CCCCCCCA0CCCCCCA0CCCCCCA0CCCCCCA0CCCCCCA0D7D7D74CFFFFFF00FFFF 732 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 733 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 734 } 591 735 end 592 736 object MenuItem31: TMenuItem -
trunk/Forms/UMainForm.pas
r35 r36 120 120 procedure AProgramPauseExecute(Sender: TObject); 121 121 procedure AProgramRunToCursorExecute(Sender: TObject); 122 procedure AProgramRunExecute(Sender: TObject); 122 123 procedure AProgramShowExecutionPointExecute(Sender: TObject); 123 124 procedure AProgramStepIntoExecute(Sender: TObject); … … 130 131 procedure AProjectSaveAsExecute(Sender: TObject); 131 132 procedure AProjectSaveExecute(Sender: TObject); 132 procedure AProgramRunExecute(Sender: TObject);133 133 procedure AShowSourcePositionExecute(Sender: TObject); 134 134 procedure AShowTargetPositionExecute(Sender: TObject); … … 155 155 procedure ProjectOpen(FileName: string); 156 156 procedure SetCurrentTarget(AValue: TTarget); 157 procedure UpdateToolBarHints; 157 158 public 158 159 Modified: Boolean; 159 160 ProjectFileName: string; 160 BreakPoints: TListInteger;161 161 Targets: TTargetList; 162 162 LastOpenedList: TLastOpenedList; … … 195 195 else AProjectNew.Execute; 196 196 UpdateInterface; 197 UpdateToolBarHints; 198 UpdateTargetList; 197 199 end; 198 200 … … 266 268 FCurrentTarget.OnChangeState := TargetStateChanged; 267 269 UpdateInterface; 270 end; 271 272 procedure TMainForm.UpdateToolBarHints; 273 var 274 I: Integer; 275 begin 276 for I := 0 to ToolBar1.ControlCount - 1 do 277 ToolBar1.Controls[I].Hint := ToolBar1.Controls[I].Caption; 268 278 end; 269 279 … … 327 337 AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities); 328 338 AProgramStepInto.Enabled := (tcStepInto in CurrentTarget.Capabilities) and 329 (ProjectFileName <> '') and ( CurrentTarget.State = rsPaused);339 (ProjectFileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 330 340 AProgramStepOut.Enabled := (tcStepOut in CurrentTarget.Capabilities) and 331 341 (ProjectFileName <> '') and (CurrentTarget.State = rsPaused); 332 342 AProgramRunToCursor.Enabled := (tcRunToCursor in CurrentTarget.Capabilities) and 333 (ProjectFileName <> '') and ( CurrentTarget.State = rsPaused);343 (ProjectFileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 334 344 AProgramStepOver.Enabled := (tcStepOver in CurrentTarget.Capabilities) and 335 (ProjectFileName <> '') and ( CurrentTarget.State = rsPaused);345 (ProjectFileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 336 346 AProgramShowExecutionPoint.Enabled := (tcPause in CurrentTarget.Capabilities) and 337 347 (ProjectFileName <> '') and (CurrentTarget.State = rsPaused); … … 339 349 AShowTargetPosition.Enabled := CurrentTarget.Compiled; 340 350 UpdateStatusBar; 341 UpdateTargetList;342 351 end; 343 352 … … 364 373 procedure TMainForm.FormCreate(Sender: TObject); 365 374 begin 366 BreakPoints := TListInteger.Create;367 375 Targets := TTargetList.Create; 368 376 Targets.Add(TTargetInterpretter.Create); … … 382 390 LastOpenedList.Free; 383 391 Targets.Free; 384 BreakPoints.Free;385 392 end; 386 393 … … 391 398 if CurrentTarget is TTargetInterpretter then 392 399 TTargetInterpretter(CurrentTarget).Input := InterpreterForm.MemoInput.Lines.Text; 393 CurrentTarget.SourceCode := MemoSource.Text;394 400 if not CurrentTarget.Compiled then AProgramCompile.Execute; 395 401 CurrentTarget.Run; … … 521 527 522 528 procedure TMainForm.ABreakpointToggleExecute(Sender: TObject); 523 begin 524 //BreakPoints.Add(); 529 var 530 DebugStep: TDebugStep; 531 BreakPoint: TBreakPoint; 532 begin 533 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart); 534 if Assigned(DebugStep) then begin 535 BreakPoint := CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition); 536 if Assigned(BreakPoint) then 537 CurrentTarget.BreakPoints.Delete(CurrentTarget.BreakPoints.IndexOf(BreakPoint)) 538 else CurrentTarget.BreakPoints.AddItem(DebugStep.TargetPosition); 539 end; 525 540 end; 526 541 527 542 procedure TMainForm.AProgramPauseExecute(Sender: TObject); 528 543 begin 529 CurrentTarget.Pause 544 CurrentTarget.Pause; 530 545 end; 531 546 … … 535 550 begin 536 551 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart); 537 CurrentTarget.RunToCursor(DebugStep.TargetPosition); 552 if CurrentTarget.State = rsStopped then begin 553 if not CurrentTarget.Compiled then AProgramCompile.Execute; 554 CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition); 555 AProgramRun.Execute; 556 end else CurrentTarget.RunToCursor(DebugStep.TargetPosition); 538 557 end; 539 558 … … 545 564 MemoSource.SelStart := DebugStep.SourcePosition; 546 565 MemoTarget.SelStart := DebugStep.TargetPosition; 566 if PageControl1.TabIndex = 0 then MemoSource.SetFocus; 567 if PageControl1.TabIndex = 1 then MemoTarget.SetFocus; 547 568 end; 548 569 549 570 procedure TMainForm.AProgramStepIntoExecute(Sender: TObject); 550 571 begin 551 CurrentTarget.StepInto; 572 if CurrentTarget.State = rsStopped then begin 573 if not CurrentTarget.Compiled then AProgramCompile.Execute; 574 CurrentTarget.BreakPoints.SetSystem(TDebugStep(CurrentTarget.DebugSteps.First).TargetPosition); 575 AProgramRun.Execute; 576 end else CurrentTarget.StepInto; 552 577 end; 553 578 … … 559 584 procedure TMainForm.AProgramStepOverExecute(Sender: TObject); 560 585 begin 561 CurrentTarget.StepOver; 586 if CurrentTarget.State = rsStopped then begin 587 if not CurrentTarget.Compiled then AProgramCompile.Execute; 588 CurrentTarget.BreakPoints.SetSystem(TDebugStep(CurrentTarget.DebugSteps.First).TargetPosition); 589 AProgramRun.Execute; 590 end else CurrentTarget.StepOver; 562 591 end; 563 592 -
trunk/Languages/LazFuckIDE.cs.po
r35 r36 383 383 msgstr "Program pÅekroÄil dolnà omezenÃ" 384 384 385 #: utargetinterpretter.sprogramnotrunning 386 msgid "Program not running" 387 msgstr "" 388 385 389 #: utargetinterpretter.sprogramupperlimit 386 390 msgctxt "utargetinterpretter.sprogramupperlimit" -
trunk/Languages/LazFuckIDE.po
r35 r36 374 374 msgstr "" 375 375 376 #: utargetinterpretter.sprogramnotrunning 377 msgid "Program not running" 378 msgstr "" 379 376 380 #: utargetinterpretter.sprogramupperlimit 377 381 msgctxt "utargetinterpretter.sprogramupperlimit" -
trunk/Target/UTarget.pas
r35 r36 32 32 function SearchByTargetPos(Pos: Integer): TDebugStep; 33 33 procedure AddStep(SourcePos, TargetPos: Integer; Operation: TStepOperation); 34 end; 35 36 TBreakPoint = class 37 TargetAddress: Integer; 38 System: Boolean; 39 end; 40 41 { TBreakPointList } 42 43 TBreakPointList = class(TListObject) 44 procedure AddItem(TargetAddress: Integer); 45 procedure SetSystem(TargetAddress: Integer); 46 procedure ClearSystem; 47 function SearchByTargetPos(Pos: Integer): TBreakPoint; 34 48 end; 35 49 … … 50 64 function LongFileName(FileName: string): string; 51 65 function GetExecutionPosition: Integer; virtual; 66 procedure SetState(AValue: TRunState); virtual; 52 67 public 53 68 Name: string; … … 59 74 ProjectFileName: string; 60 75 Capabilities: TTargetCapabilities; 61 BreakPoints: T ListInteger;76 BreakPoints: TBreakPointList; 62 77 DebugSteps: TDebugStepList; 63 78 constructor Create; virtual; … … 75 90 procedure LoadFromRegistry(Root: HKEY; Key: string); virtual; 76 91 procedure SaveToRegistry(Root: HKEY; Key: string); virtual; 77 property State: TRunState read FState ;92 property State: TRunState read FState write SetState; 78 93 property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState; 79 94 property SourceCode: string write SetSourceCode; … … 98 113 99 114 implementation 115 116 { TBreakPointList } 117 118 procedure TBreakPointList.AddItem(TargetAddress: Integer); 119 var 120 NewItem: TBreakPoint; 121 begin 122 NewItem := TBreakPoint.Create; 123 NewItem.TargetAddress := TargetAddress; 124 Add(NewItem); 125 end; 126 127 procedure TBreakPointList.SetSystem(TargetAddress: Integer); 128 var 129 NewItem: TBreakPoint; 130 begin 131 ClearSystem; 132 NewItem := TBreakPoint.Create; 133 NewItem.TargetAddress := TargetAddress; 134 NewItem.System := True; 135 Add(NewItem); 136 end; 137 138 procedure TBreakPointList.ClearSystem; 139 var 140 I: Integer; 141 begin 142 for I := Count - 1 downto 0 do 143 if TBreakPoint(Items[I]).System then Delete(I); 144 end; 145 146 function TBreakPointList.SearchByTargetPos(Pos: Integer): TBreakPoint; 147 var 148 I: Integer; 149 begin 150 I := 0; 151 while (I < Count) and (TBreakPoint(Items[I]).TargetAddress < Pos) do Inc(I); 152 if I < Count then Result := TBreakPoint(Items[I]) 153 else Result := nil; 154 end; 100 155 101 156 { TDebugStepList } … … 191 246 begin 192 247 248 end; 249 250 procedure TTarget.SetState(AValue: TRunState); 251 begin 252 if FState = AValue then Exit; 253 FState := AValue; 193 254 end; 194 255 … … 218 279 inherited; 219 280 Optimization := coNormal; 220 BreakPoints := T ListInteger.Create;281 BreakPoints := TBreakPointList.Create; 221 282 DebugSteps := TDebugStepList.Create; 222 283 end; -
trunk/Target/UTargetInterpretter.pas
r35 r36 34 34 function GetMemorySize: Integer; 35 35 procedure SetMemorySize(AValue: Integer); 36 procedure SetState(AValue: TRunState);37 36 procedure SetThread(State: Boolean); 38 37 procedure PrepareJumpTable; … … 48 47 procedure PrepareBreakPoints; 49 48 protected 49 procedure SetState(AValue: TRunState); override; 50 50 function GetTargetCode: string; override; 51 51 function GetExecutionPosition: Integer; override; … … 93 93 SJumpTableColision = 'Jump table colision'; 94 94 SMemoryCellOutOfRange = 'Memory cell %s value out of range'; 95 SProgramNotRunning = 'Program not running'; 95 96 96 97 { TTargetInterpretterThread } … … 104 105 if FProgramBreakpoints[SourcePosition] then begin 105 106 FProgramBreakpoints[SourcePosition] := False; 106 S etState(rsPaused);107 State := rsPaused; 107 108 end else begin 108 109 FCommandTable[FProgram[SourcePosition]]; … … 113 114 if State = rsPaused then Sleep(1); 114 115 end; 115 S etState(rsStopped);116 State := rsStopped; 116 117 until Terminated or (State = rsStopped); 117 118 end; … … 295 296 Memory[I] := 0; 296 297 FStepCount := 0; 298 PrepareBreakPoints; 297 299 end; 298 300 … … 305 307 FProgramBreakpoints[I] := False; 306 308 for I := 0 to BreakPoints.Count - 1 do 307 FProgramBreakpoints[ BreakPoints[I]] := True;309 FProgramBreakpoints[TBreakPoint(BreakPoints[I]).TargetAddress] := True; 308 310 end; 309 311 … … 324 326 procedure TTargetInterpretter.Run; 325 327 begin 326 SetState(rsRunning); 327 Reset; 328 PrepareBreakPoints; 328 if FState = rsStopped then begin 329 Reset; 330 SetThread(True); 331 State := rsRunning; 332 end else State := rsRunning; 333 end; 334 335 procedure TTargetInterpretter.Pause; 336 begin 337 if State = rsRunning then State := rsPaused; 338 end; 339 340 procedure TTargetInterpretter.Stop; 341 begin 342 State := rsStopped; 329 343 SetThread(False); 330 SetThread(True);331 end;332 333 procedure TTargetInterpretter.Pause;334 begin335 if State = rsRunning then SetState(rsPaused);336 end;337 338 procedure TTargetInterpretter.Stop;339 begin340 SetState(rsStopped);341 344 end; 342 345 … … 345 348 Step: TDebugStep; 346 349 begin 347 Step := DebugSteps.SearchByTargetPos(SourcePosition); 348 FProgramBreakpoints[Step.TargetPosition + 1] := True; 350 if State = rsPaused then begin 351 Step := DebugSteps.SearchByTargetPos(SourcePosition); 352 BreakPoints.SetSystem(Step.TargetPosition + 1); 353 Run; 354 end else raise Exception.Create(SProgramNotRunning); 349 355 end; 350 356 … … 352 358 var 353 359 Step: TDebugStep; 354 begin 360 StepIndex: Integer; 361 Nesting: Integer; 362 begin 363 if State = rsPaused then begin 364 Step := DebugSteps.SearchByTargetPos(SourcePosition); 365 if Step.Operation = soStepIn then begin 366 StepIndex := DebugSteps.IndexOf(Step); 367 Inc(StepIndex); 368 Nesting := 1; 369 while (StepIndex < DebugSteps.Count) and (Nesting > 0) do begin 370 if TDebugStep(DebugSteps[StepIndex]).Operation <> soStepOut then Dec(Nesting); 371 if TDebugStep(DebugSteps[StepIndex]).Operation <> soStepIn then Inc(Nesting); 372 Inc(StepIndex); 373 end; 374 BreakPoints.SetSystem(TDebugStep(DebugSteps[StepIndex]).TargetPosition); 375 end else BreakPoints.SetSystem(Step.TargetPosition + 1); 376 Run; 377 end else raise Exception.Create(SProgramNotRunning); 355 378 end; 356 379 357 380 procedure TTargetInterpretter.StepOut; 358 begin 359 inherited StepOut; 381 var 382 Step: TDebugStep; 383 StepIndex: Integer; 384 begin 385 if State = rsPaused then begin 386 Step := DebugSteps.SearchByTargetPos(SourcePosition); 387 StepIndex := DebugSteps.IndexOf(Step); 388 while (StepIndex < DebugSteps.Count) and (TDebugStep(DebugSteps[StepIndex]).Operation <> soStepOut) do Inc(StepIndex); 389 if StepIndex < DebugSteps.Count then begin 390 Breakpoints.SetSystem(TDebugStep(DebugSteps[StepIndex]).TargetPosition); 391 Run; 392 end; 393 end else raise Exception.Create(SProgramNotRunning); 360 394 end; 361 395 362 396 procedure TTargetInterpretter.RunToCursor(Pos: Integer); 363 397 begin 364 FProgramBreakpoints[Pos] := True; 398 Breakpoints.SetSystem(Pos); 399 Run; 365 400 end; 366 401 -
trunk/UApplicationInfo.pas
r31 r36 53 53 Name := 'LazFuck'; 54 54 Identification := 1; 55 ReleaseDate := EncodeDate(2012, 2, 1 8);55 ReleaseDate := EncodeDate(2012, 2, 19); 56 56 MajorVersion := 0; 57 57 MinorVersion := 1;
Note:
See TracChangeset
for help on using the changeset viewer.