Changeset 125 for trunk/UTarget.pas


Ignore:
Timestamp:
Jan 14, 2022, 3:15:52 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTarget.pas

    r124 r125  
    173173begin
    174174  if Count > 0 then begin
    175     TMessage(Last).Text := TMessage(Last).Text + Text;
     175    Last.Text := Last.Text + Text;
    176176    DoChange;
    177177  end else AddMessage(Text);
     
    210210begin
    211211  for I := Count - 1 downto 0 do
    212     if TBreakPoint(Items[I]).System then Delete(I);
     212    if Items[I].System then Delete(I);
    213213end;
    214214
     
    218218begin
    219219  I := 0;
    220   while (I < Count) and (TBreakPoint(Items[I]).TargetAddress < Pos) do Inc(I);
    221   if I < Count then Result := TBreakPoint(Items[I])
     220  while (I < Count) and (Items[I].TargetAddress < Pos) do Inc(I);
     221  if I < Count then Result := Items[I]
    222222    else Result := nil;
    223223end;
     
    231231begin
    232232  I := 0;
    233   while (I < Count) and (TDebugStep(Items[I]).SourcePosition < Pos) do Inc(I);
    234   if I < Count then Result := TDebugStep(Items[I])
     233  while (I < Count) and (Items[I].SourcePosition < Pos) do Inc(I);
     234  if I < Count then Result := Items[I]
    235235    else Result := nil;
    236236end;
     
    241241begin
    242242  I := 0;
    243   while (I < Count) and (TDebugStep(Items[I]).ProgramPosition < Pos) do Inc(I);
    244   if I < Count then Result := TDebugStep(Items[I])
     243  while (I < Count) and (Items[I].ProgramPosition < Pos) do Inc(I);
     244  if I < Count then Result := Items[I]
    245245    else Result := nil;
    246246end;
     
    252252begin
    253253  I := 0;
    254   while (I < Count) and (TDebugStep(Items[I]).TargetPosition < Pos) do Inc(I);
    255   if I < Count then Result := TDebugStep(Items[I])
     254  while (I < Count) and (Items[I].TargetPosition < Pos) do Inc(I);
     255  if I < Count then Result := Items[I]
    256256    else Result := nil;
    257257end;
     
    262262begin
    263263  I := 0;
    264   while (I < Count) and (TDebugStep(Items[I]).ProgramPosition < Pos) do Inc(I);
     264  while (I < Count) and (Items[I].ProgramPosition < Pos) do Inc(I);
    265265  if I < Count then Result := I
    266266    else Result := -1;
     
    289289  Last := SearchIndexByProgramPos(OldProgramTo);
    290290  for I := Last downto First + 1 do Delete(I);
    291   TDebugStep(Items[First]).ProgramPosition := NewProgram;
    292   TDebugStep(Items[First]).TargetPosition := NewTarget;
     291  Items[First].ProgramPosition := NewProgram;
     292  Items[First].TargetPosition := NewTarget;
    293293end;
    294294
     
    304304    CurrentContext := Context;
    305305    for I := 0 to Count - 1 do
    306       TTarget(Items[I]).LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name));
     306      Items[I].LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name));
    307307  finally
    308308    Free;
     
    318318    CurrentContext := Context;
    319319    for I := 0 to Count - 1 do
    320     with TTarget(Items[I]) do
    321       TTarget(Items[I]).SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name));
     320    with Items[I] do
     321      Items[I].SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name));
    322322  finally
    323323    Free;
     
    330330begin
    331331  I := 0;
    332   while (I < Count) and (TTarget(Items[I]).Name <> Name) do Inc(I);
    333   if I < Count then Result := TTarget(Items[I])
     332  while (I < Count) and (Items[I].Name <> Name) do Inc(I);
     333  if I < Count then Result := Items[I]
    334334    else Result := nil;
    335335end;
     
    345345    for I := 0 to Count - 1 do begin
    346346      NewMenuItem := TMenuItem.Create(MenuItem);
    347       NewMenuItem.Caption := TTarget(Items[I]).Name;
     347      NewMenuItem.Caption := Items[I].Name;
    348348      NewMenuItem.OnClick := Action;
    349       NewMenuItem.ImageIndex := TTarget(Items[I]).ImageIndex;
    350       if TTarget(Items[I]) = CurrentTarget then NewMenuItem.Checked := True;
     349      NewMenuItem.ImageIndex := Items[I].ImageIndex;
     350      if Items[I] = CurrentTarget then NewMenuItem.Checked := True;
    351351      MenuItem.Add(NewMenuItem);
    352352    end;
     
    407407  FreeAndNil(DebugSteps);
    408408  FreeAndNil(BreakPoints);
    409   inherited Destroy;
     409  inherited;
    410410end;
    411411
     
    505505procedure TTarget.Pause;
    506506begin
    507 
    508507end;
    509508
     
    514513procedure TTarget.StepOver;
    515514begin
    516 
    517515end;
    518516
    519517procedure TTarget.StepInto;
    520518begin
    521 
    522519end;
    523520
    524521procedure TTarget.StepOut;
    525522begin
    526 
    527523end;
    528524
    529525procedure TTarget.RunToCursor(Pos: Integer);
    530526begin
    531 
    532527end;
    533528
Note: See TracChangeset for help on using the changeset viewer.