Changeset 39
- Timestamp:
- Feb 19, 2012, 12:41:25 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormCPU.lfm
r38 r39 4 4 Top = 127 5 5 Width = 414 6 Caption = ' Interpretter'6 Caption = 'CPU' 7 7 ClientHeight = 287 8 8 ClientWidth = 414 -
trunk/Forms/UFormCPU.lrt
r38 r39 1 TFORMCPU.CAPTION= Interpretter1 TFORMCPU.CAPTION=CPU 2 2 TFORMCPU.LABEL4.CAPTION=Step counter: 3 3 TFORMCPU.LABEL7.CAPTION=Speed: -
trunk/Forms/UFormInput.lfm
r38 r39 4 4 Top = 32 5 5 Width = 320 6 Caption = ' FormInput'6 Caption = 'Input' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 -
trunk/Forms/UFormInput.lrt
r38 r39 1 TFORMINPUT.CAPTION= FormInput1 TFORMINPUT.CAPTION=Input 2 2 TFORMINPUT.LABEL1.CAPTION=Input: -
trunk/Forms/UFormMain.lfm
r38 r39 1 1 object MainForm: TMainForm 2 Left = 2 083 Height = 6094 Top = 1345 Width = 7902 Left = 215 3 Height = 414 4 Top = 271 5 Width = 665 6 6 Caption = 'LazFuck' 7 ClientHeight = 5848 ClientWidth = 7907 ClientHeight = 389 8 ClientWidth = 665 9 9 Menu = MainMenu1 10 10 OnCloseQuery = FormCloseQuery … … 17 17 Left = 0 18 18 Height = 21 19 Top = 56320 Width = 79019 Top = 368 20 Width = 665 21 21 Panels = < 22 22 item … … 35 35 Height = 26 36 36 Top = 0 37 Width = 79037 Width = 665 38 38 Images = ImageList1 39 39 ParentShowHint = False … … 118 118 end 119 119 object PageControlRight: TPageControl 120 Left = 397121 Height = 537120 Left = 272 121 Height = 342 122 122 Top = 26 123 123 Width = 393 … … 129 129 object TabSheetDebug: TTabSheet 130 130 Caption = 'Debug' 131 ClientHeight = 535131 ClientHeight = 340 132 132 ClientWidth = 341 133 133 object PanelInput: TPanel 134 134 Left = 0 135 Height = 133135 Height = 64 136 136 Top = 0 137 137 Width = 341 … … 144 144 Left = 0 145 145 Height = 5 146 Top = 133146 Top = 64 147 147 Width = 341 148 148 Align = alTop … … 151 151 object PanelOutput: TPanel 152 152 Left = 0 153 Height = 123154 Top = 138153 Height = 259 154 Top = 69 155 155 Width = 341 156 156 Align = alTop … … 162 162 Left = 0 163 163 Height = 5 164 Top = 261164 Top = 328 165 165 Width = 341 166 166 Align = alTop … … 169 169 object PanelCPU: TPanel 170 170 Left = 0 171 Height = 139172 Top = 266171 Height = 86 172 Top = 333 173 173 Width = 341 174 174 Align = alTop … … 180 180 Left = 0 181 181 Height = 5 182 Top = 405182 Top = 340 183 183 Width = 341 184 184 Align = alTop … … 187 187 object PanelMemory: TPanel 188 188 Left = 0 189 Height = 1 25190 Top = 410189 Height = 1 190 Top = 340 191 191 Width = 341 192 192 Align = alClient … … 197 197 end 198 198 object Splitter1: TSplitter 199 Left = 392200 Height = 537199 Left = 267 200 Height = 342 201 201 Top = 26 202 202 Width = 5 … … 206 206 object PanelLeft: TPanel 207 207 Left = 0 208 Height = 537208 Height = 342 209 209 Top = 26 210 Width = 392210 Width = 267 211 211 Align = alClient 212 212 BevelOuter = bvNone 213 ClientHeight = 537214 ClientWidth = 392213 ClientHeight = 342 214 ClientWidth = 267 215 215 TabOrder = 4 216 216 object PageControlMain: TPageControl 217 217 Left = 0 218 Height = 414218 Height = 219 219 219 Top = 0 220 Width = 392220 Width = 267 221 221 ActivePage = TabSheetSource 222 222 Align = alClient … … 226 226 object TabSheetSource: TTabSheet 227 227 Caption = 'Source code' 228 ClientHeight = 387229 ClientWidth = 390228 ClientHeight = 192 229 ClientWidth = 265 230 230 object MemoSource: TMemo 231 231 Left = 0 232 Height = 387232 Height = 192 233 233 Top = 0 234 Width = 390234 Width = 265 235 235 Align = alClient 236 236 Font.Height = -12 … … 249 249 object TabSheetTarget: TTabSheet 250 250 Caption = 'Target code' 251 ClientHeight = 387252 ClientWidth = 390251 ClientHeight = 192 252 ClientWidth = 265 253 253 object MemoTarget: TMemo 254 254 Left = 0 … … 267 267 Left = 0 268 268 Height = 118 269 Top = 419270 Width = 392269 Top = 224 270 Width = 267 271 271 ActivePage = TabSheetMessages 272 272 Align = alBottom … … 282 282 Left = 0 283 283 Height = 5 284 Top = 414285 Width = 392284 Top = 219 285 Width = 267 286 286 Align = alBottom 287 287 ResizeAnchor = akBottom -
trunk/Forms/UFormMain.pas
r38 r39 255 255 256 256 procedure TMainForm.TargetStateChanged(Sender: TObject); 257 var 258 DebugStep: TDebugStep; 259 begin 257 begin 258 UpdateInterface; 260 259 if CurrentTarget.State = rsPaused then 261 260 AProgramShowExecutionPoint.Execute; 262 UpdateInterface;263 261 end; 264 262 … … 322 320 FormMesssages.Align := alClient; 323 321 FormMesssages.Show; 322 PageControlRight.Width := MainForm.Width div 2; 323 PageControlBottom.Height := MainForm.Height div 5; 324 324 end; 325 325 … … 440 440 procedure TMainForm.AProgramRunExecute(Sender: TObject); 441 441 begin 442 FormCPU.LastStepCounter := 0;443 FormCPU.Show;444 442 if CurrentTarget is TTargetInterpretter then 445 443 TTargetInterpretter(CurrentTarget).Input := FormInput.MemoInput.Lines.Text; … … 595 593 DebugStep: TDebugStep; 596 594 begin 597 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart);598 595 if CurrentTarget.State = rsStopped then begin 599 596 if not CurrentTarget.Compiled then AProgramCompile.Execute; 597 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart); 600 598 CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition); 601 599 AProgramRun.Execute; 602 end else CurrentTarget.RunToCursor(DebugStep.TargetPosition); 600 end else begin 601 DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart); 602 CurrentTarget.RunToCursor(DebugStep.TargetPosition); 603 end; 603 604 end; 604 605 -
trunk/Forms/UFormMemory.lfm
r38 r39 4 4 Top = 32 5 5 Width = 391 6 Caption = ' FormMemory'6 Caption = 'Memory' 7 7 ClientHeight = 259 8 8 ClientWidth = 391 -
trunk/Forms/UFormMemory.lrt
r38 r39 1 TFORMMEMORY.CAPTION= FormMemory1 TFORMMEMORY.CAPTION=Memory 2 2 TFORMMEMORY.LABEL6.CAPTION=Memory: 3 3 TFORMMEMORY.LISTVIEWMEMORY.COLUMNS[0].CAPTION=Address -
trunk/Forms/UFormMessages.lfm
r38 r39 4 4 Top = 32 5 5 Width = 320 6 Caption = ' FormMesssages'6 Caption = 'Messages' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 -
trunk/Forms/UFormMessages.lrt
r38 r39 1 TFORMMESSSAGES.CAPTION= FormMesssages1 TFORMMESSSAGES.CAPTION=Messages -
trunk/Forms/UFormOutput.lfm
r38 r39 4 4 Top = 32 5 5 Width = 320 6 Caption = ' FormOutput'6 Caption = 'Output' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 -
trunk/Forms/UFormOutput.lrt
r38 r39 1 TFORMOUTPUT.CAPTION= FormOutput1 TFORMOUTPUT.CAPTION=Output 2 2 TFORMOUTPUT.LABEL2.CAPTION=Output: -
trunk/Languages/LazFuckIDE.cs.po
r38 r39 40 40 41 41 #: tformcpu.caption 42 #| msgid "Interpretter" 42 43 msgctxt "tformcpu.caption" 43 msgid " Interpretter"44 msgstr " Interpreter"44 msgid "CPU" 45 msgstr "CPU" 45 46 46 47 #: tformcpu.label3.caption … … 85 86 86 87 #: tforminput.caption 87 msgid " FormInput"88 msgstr " "88 msgid "Input" 89 msgstr "Vstup" 89 90 90 91 #: tforminput.label1.caption … … 94 95 95 96 #: tformmemory.caption 96 msgid " FormMemory"97 msgstr " "97 msgid "Memory" 98 msgstr "PamÄÅ¥" 98 99 99 100 #: tformmemory.label6.caption … … 113 114 114 115 #: tformmesssages.caption 115 msgid "FormMesssages" 116 msgstr "" 116 #| msgid "Messsages" 117 msgctxt "tformmesssages.caption" 118 msgid "Messages" 119 msgstr "Zprávy" 117 120 118 121 #: tformoutput.caption 119 msgid " FormOutput"120 msgstr " "122 msgid "Output" 123 msgstr "VÃœstup" 121 124 122 125 #: tformoutput.label2.caption … … 246 249 #: tmainform.aprogramshowexecutionpoint.caption 247 250 msgid "Show execution point" 248 msgstr " "251 msgstr "Ukázat bod vykonánÃ" 249 252 250 253 #: tmainform.aprogramstepinto.caption … … 356 359 msgctxt "tmainform.tabsheetdebug.caption" 357 360 msgid "Debug" 358 msgstr " "361 msgstr "LadÄnÃ" 359 362 360 363 #: tmainform.tabsheetmessages.caption 361 364 msgctxt "tmainform.tabsheetmessages.caption" 362 365 msgid "Messages" 363 msgstr " "366 msgstr "Zprávy" 364 367 365 368 #: tmainform.tabsheetsource.caption … … 537 540 #: utargetinterpretter.sprogramnotrunning 538 541 msgid "Program not running" 539 msgstr " "542 msgstr "Program nebÄÅŸÃ" 540 543 541 544 #: utargetinterpretter.sprogramupperlimit -
trunk/Languages/LazFuckIDE.po
r38 r39 33 33 #: tformcpu.caption 34 34 msgctxt "TFORMCPU.CAPTION" 35 msgid " Interpretter"35 msgid "CPU" 36 36 msgstr "" 37 37 … … 77 77 78 78 #: tforminput.caption 79 msgid " FormInput"79 msgid "Input" 80 80 msgstr "" 81 81 … … 86 86 87 87 #: tformmemory.caption 88 msgid " FormMemory"88 msgid "Memory" 89 89 msgstr "" 90 90 … … 105 105 106 106 #: tformmesssages.caption 107 msgid "FormMesssages" 107 msgctxt "tformmesssages.caption" 108 msgid "Messages" 108 109 msgstr "" 109 110 110 111 #: tformoutput.caption 111 msgid " FormOutput"112 msgid "Output" 112 113 msgstr "" 113 114 -
trunk/Target/UTarget.pas
r36 r39 44 44 procedure AddItem(TargetAddress: Integer); 45 45 procedure SetSystem(TargetAddress: Integer); 46 procedure AddSystem(TargetAddress: Integer); 46 47 procedure ClearSystem; 47 48 function SearchByTargetPos(Pos: Integer): TBreakPoint; … … 126 127 127 128 procedure TBreakPointList.SetSystem(TargetAddress: Integer); 129 begin 130 ClearSystem; 131 AddSystem(TargetAddress); 132 end; 133 134 procedure TBreakPointList.AddSystem(TargetAddress: Integer); 128 135 var 129 136 NewItem: TBreakPoint; 130 137 begin 131 ClearSystem;132 138 NewItem := TBreakPoint.Create; 133 139 NewItem.TargetAddress := TargetAddress; -
trunk/Target/UTargetInterpretter.pas
r36 r39 14 14 15 15 TTargetInterpretterThread = class(TThread) 16 private 17 FNewState: TRunState; 18 procedure DoSetState; 19 procedure SetStateSafe(State: TRunState); 20 public 16 21 Parent: TTargetInterpretter; 17 22 procedure Execute; override; … … 98 103 99 104 procedure TTargetInterpretterThread.Execute; 105 var 106 BreakPoint: TBreakPoint; 100 107 begin 101 108 with Parent do … … 104 111 if State = rsRunning then begin 105 112 if FProgramBreakpoints[SourcePosition] then begin 106 FProgramBreakpoints[SourcePosition] := False; 107 State := rsPaused; 113 BreakPoint := BreakPoints.SearchByTargetPos(SourcePosition); 114 if BreakPoint.System then BreakPoints.Delete(BreakPoints.IndexOf(BreakPoint)); 115 SetStateSafe(rsPaused); 108 116 end else begin 109 117 FCommandTable[FProgram[SourcePosition]]; … … 114 122 if State = rsPaused then Sleep(1); 115 123 end; 116 State := rsStopped;124 if State <> rsStopped then SetStateSafe(rsStopped); 117 125 until Terminated or (State = rsStopped); 126 end; 127 128 procedure TTargetInterpretterThread.DoSetState; 129 begin 130 Parent.State := FNewState; 131 end; 132 133 procedure TTargetInterpretterThread.SetStateSafe(State: TRunState); 134 begin 135 FNewState := State; 136 Synchronize(DoSetState); 118 137 end; 119 138 … … 307 326 FProgramBreakpoints[I] := False; 308 327 for I := 0 to BreakPoints.Count - 1 do 309 FProgramBreakpoints[TBreakPoint(BreakPoints[I]).TargetAddress] := True; 328 if TBreakPoint(BreakPoints[I]).TargetAddress < Length(FProgramBreakpoints) then 329 FProgramBreakpoints[TBreakPoint(BreakPoints[I]).TargetAddress] := True; 310 330 end; 311 331 … … 326 346 procedure TTargetInterpretter.Run; 327 347 begin 348 PrepareBreakPoints; 328 349 if FState = rsStopped then begin 329 350 Reset; … … 347 368 var 348 369 Step: TDebugStep; 370 StepIndex: Integer; 371 Nesting: Integer; 349 372 begin 350 373 if State = rsPaused then begin 351 374 Step := DebugSteps.SearchByTargetPos(SourcePosition); 352 BreakPoints.SetSystem(Step.TargetPosition + 1); 375 if Step.Operation = soStepOut then begin 376 BreakPoints.SetSystem(Step.TargetPosition + 1); 377 Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]); 378 BreakPoints.AddSystem(Step.TargetPosition); 379 end else 380 if Step.Operation = soStepIn then begin 381 BreakPoints.SetSystem(Step.TargetPosition + 1); 382 Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]); 383 BreakPoints.AddSystem(Step.TargetPosition); 384 end else BreakPoints.SetSystem(Step.TargetPosition + 1); 353 385 Run; 354 386 end else raise Exception.Create(SProgramNotRunning); … … 363 395 if State = rsPaused then begin 364 396 Step := DebugSteps.SearchByTargetPos(SourcePosition); 397 if Step.Operation = soStepOut then begin 398 BreakPoints.SetSystem(Step.TargetPosition + 1); 399 Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]); 400 BreakPoints.AddSystem(Step.TargetPosition); 401 end else 365 402 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); 403 Step := DebugSteps.SearchByTargetPos(SourceJump[Step.TargetPosition]); 404 BreakPoints.SetSystem(Step.TargetPosition + 1); 375 405 end else BreakPoints.SetSystem(Step.TargetPosition + 1); 376 406 Run; … … 382 412 Step: TDebugStep; 383 413 StepIndex: Integer; 414 Nesting: Integer; 384 415 begin 385 416 if State = rsPaused then begin 386 417 Step := DebugSteps.SearchByTargetPos(SourcePosition); 387 418 StepIndex := DebugSteps.IndexOf(Step); 388 while (StepIndex < DebugSteps.Count) and (TDebugStep(DebugSteps[StepIndex]).Operation <> soStepOut) do Inc(StepIndex); 419 Nesting := 1; 420 while (StepIndex < DebugSteps.Count) and (Nesting > 0) do begin 421 if TDebugStep(DebugSteps[StepIndex]).Operation = soStepIn then Inc(Nesting); 422 if TDebugStep(DebugSteps[StepIndex]).Operation = soStepOut then Dec(Nesting); 423 Inc(StepIndex); 424 end; 389 425 if StepIndex < DebugSteps.Count then begin 390 426 Breakpoints.SetSystem(TDebugStep(DebugSteps[StepIndex]).TargetPosition); 391 Run;392 427 end; 428 Run; 393 429 end else raise Exception.Create(SProgramNotRunning); 394 430 end;
Note:
See TracChangeset
for help on using the changeset viewer.