mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 12:09:21 +02:00
debugger: increase refresh speed of callstack dialog on breakpoint toggle
git-svn-id: trunk@19129 -
This commit is contained in:
parent
c770cd7d3b
commit
542f99b32a
@ -102,6 +102,7 @@ type
|
|||||||
FViewCount: Integer;
|
FViewCount: Integer;
|
||||||
FViewLimit: Integer;
|
FViewLimit: Integer;
|
||||||
FViewStart: Integer;
|
FViewStart: Integer;
|
||||||
|
function GetImageIndex(Entry: TCallStackEntry): Integer;
|
||||||
procedure SetBreakPoints(const AValue: TIDEBreakPoints);
|
procedure SetBreakPoints(const AValue: TIDEBreakPoints);
|
||||||
procedure SetViewLimit(const AValue: Integer);
|
procedure SetViewLimit(const AValue: Integer);
|
||||||
procedure SetViewStart(AStart: Integer);
|
procedure SetViewStart(AStart: Integer);
|
||||||
@ -178,7 +179,7 @@ begin
|
|||||||
UpdateView;
|
UpdateView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCallStackDlg.UpdateView;
|
function TCallStackDlg.GetImageIndex(Entry: TCallStackEntry): Integer;
|
||||||
|
|
||||||
function HasBreakPoint(Entry: TCallStackEntry): Boolean; inline;
|
function HasBreakPoint(Entry: TCallStackEntry): Boolean; inline;
|
||||||
var
|
var
|
||||||
@ -192,6 +193,27 @@ procedure TCallStackDlg.UpdateView;
|
|||||||
Result := BreakPoints.Find(FileName, Entry.Line) <> nil;
|
Result := BreakPoints.Find(FileName, Entry.Line) <> nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if HasBreakPoint(Entry) then
|
||||||
|
begin
|
||||||
|
if Entry.Current then
|
||||||
|
Result := imgCurrentLineAtBreakPoint
|
||||||
|
else
|
||||||
|
Result := imgBreakPoint;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if Entry.Current then
|
||||||
|
Result := imgCurrentLine
|
||||||
|
else
|
||||||
|
if Entry.Source = '' then
|
||||||
|
Result := imgNoSourceLine
|
||||||
|
else
|
||||||
|
Result := imgSourceLine;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCallStackDlg.UpdateView;
|
||||||
var
|
var
|
||||||
n: Integer;
|
n: Integer;
|
||||||
Item: TListItem;
|
Item: TListItem;
|
||||||
@ -243,24 +265,7 @@ begin
|
|||||||
Item.SubItems[3] := '';
|
Item.SubItems[3] := '';
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if HasBreakPoint(Entry) then
|
Item.ImageIndex := GetImageIndex(Entry);
|
||||||
begin
|
|
||||||
if Entry.Current then
|
|
||||||
Item.ImageIndex := imgCurrentLineAtBreakPoint
|
|
||||||
else
|
|
||||||
Item.ImageIndex := imgBreakPoint;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if Entry.Current then
|
|
||||||
Item.ImageIndex := imgCurrentLine
|
|
||||||
else
|
|
||||||
if Entry.Source = '' then
|
|
||||||
Item.ImageIndex := imgNoSourceLine
|
|
||||||
else
|
|
||||||
Item.ImageIndex := imgSourceLine;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Item.SubItems[0] := IntToStr(Entry.Index);
|
Item.SubItems[0] := IntToStr(Entry.Index);
|
||||||
Source := Entry.Source;
|
Source := Entry.Source;
|
||||||
if Source = '' then // we dont have a source file => just show an adress
|
if Source = '' then // we dont have a source file => just show an adress
|
||||||
@ -447,8 +452,24 @@ end;
|
|||||||
|
|
||||||
procedure TCallStackDlg.BreakPointChanged(const ASender: TIDEBreakPoints;
|
procedure TCallStackDlg.BreakPointChanged(const ASender: TIDEBreakPoints;
|
||||||
const ABreakpoint: TIDEBreakPoint);
|
const ABreakpoint: TIDEBreakPoint);
|
||||||
|
var
|
||||||
|
i, idx: Integer;
|
||||||
|
Entry: TCallStackEntry;
|
||||||
begin
|
begin
|
||||||
UpdateView;
|
if BreakPoints = nil then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
for i := 0 to lvCallStack.Items.Count - 1 do
|
||||||
|
begin
|
||||||
|
idx := FViewStart + lvCallStack.Items[i].Index;
|
||||||
|
if idx >= CallStack.Count then
|
||||||
|
Continue;
|
||||||
|
Entry := CallStack.Entries[idx];
|
||||||
|
if Entry <> nil then
|
||||||
|
lvCallStack.Items[i].ImageIndex := GetImageIndex(Entry)
|
||||||
|
else
|
||||||
|
lvCallStack.Items[i].ImageIndex := imgNoSourceLine;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCallStackDlg.FormCreate(Sender: TObject);
|
procedure TCallStackDlg.FormCreate(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user