Changeset 36 for trunk/Target/UTarget.pas
- Timestamp:
- Feb 19, 2012, 9:44:58 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.