Changeset 40 for trunk/Target
- Timestamp:
- Feb 19, 2012, 2:13:49 PM (13 years ago)
- Location:
- trunk/Target
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/UTarget.pas
r39 r40 47 47 procedure ClearSystem; 48 48 function SearchByTargetPos(Pos: Integer): TBreakPoint; 49 end; 50 51 TMessage = class 52 Text: string; 53 Position: TPoint; 54 end; 55 56 { TMessageList } 57 58 TMessageList = class(TListObject) 59 private 60 FOnChange: TNotifyEvent; 61 procedure DoChange; 62 public 63 procedure AddMessage(Text: string); 64 procedure AppendMessage(Text: string); 65 property OnChange: TNotifyEvent read FOnChange write FOnChange; 49 66 end; 50 67 … … 77 94 BreakPoints: TBreakPointList; 78 95 DebugSteps: TDebugStepList; 96 Messages: TMessageList; 79 97 constructor Create; virtual; 80 98 destructor Destroy; override; 99 procedure Reset; virtual; 81 100 procedure OptimizeSource; 82 101 procedure Compile; virtual; … … 115 134 implementation 116 135 136 { TMessageList } 137 138 procedure TMessageList.DoChange; 139 begin 140 if Assigned(FOnChange) then FOnChange(Self); 141 end; 142 143 procedure TMessageList.AddMessage(Text: string); 144 var 145 NewItem: TMessage; 146 begin 147 NewItem := TMessage.Create; 148 NewItem.Text := Text; 149 Add(NewItem); 150 DoChange; 151 end; 152 153 procedure TMessageList.AppendMessage(Text: string); 154 begin 155 if Count > 0 then begin 156 TMessage(Last).Text := TMessage(Last).Text + Text; 157 DoChange; 158 end else AddMessage(Text); 159 end; 160 117 161 { TBreakPointList } 118 162 … … 287 331 BreakPoints := TBreakPointList.Create; 288 332 DebugSteps := TDebugStepList.Create; 333 Messages := TMessageList.Create; 289 334 end; 290 335 291 336 destructor TTarget.Destroy; 292 337 begin 338 Messages.Free; 293 339 DebugSteps.Free;; 294 340 BreakPoints.Free; 295 341 inherited Destroy; 342 end; 343 344 procedure TTarget.Reset; 345 begin 346 Messages.Clear; 296 347 end; 297 348 … … 359 410 procedure TTarget.Stop; 360 411 begin 361 362 412 end; 363 413 -
trunk/Target/UTargetInterpretter.pas
r39 r40 49 49 procedure CommandLoopStart; 50 50 procedure CommandLoopEnd; 51 procedure Reset;52 51 procedure PrepareBreakPoints; 53 52 protected … … 67 66 Input: string; 68 67 InputPosition: Integer; 68 procedure Reset; override; 69 69 procedure Compile; override; 70 70 procedure Run; override; … … 305 305 I: Integer; 306 306 begin 307 inherited; 307 308 PrepareJumpTable; 308 309 SourcePosition := 0;
Note:
See TracChangeset
for help on using the changeset viewer.