Debugger: Fix Snapshots.

This commit is contained in:
Martin 2022-02-01 17:15:48 +01:00
parent a37d077199
commit f895353287
2 changed files with 21 additions and 7 deletions

View File

@ -1035,7 +1035,9 @@ begin
else
tvWatches.NodeText[VNode, COL_WATCH_VALUE-1]:= '<not evaluated>';
if (DebugBoss <> nil) and (DebugBoss.State <> dsRun) and
if ( ((DebugBoss <> nil) and (DebugBoss.State <> dsRun)) or
((GetSelectedSnapshot <> nil) and not(AWatch is TCurrentWatch) )
) and
(WatchValue <> nil) and (WatchValue.Validity <> ddsRequested)
then begin
TypInfo := WatchValue.TypeInfo;
@ -1055,6 +1057,11 @@ begin
end;
end;
end
else
if (GetSelectedSnapshot = nil) and
(DebugBoss <> nil) and (DebugBoss.State in [dsPause, dsInternalPause])
then
tvWatches.NodeText[VNode, COL_WATCH_VALUE-1]:= '<evaluating>'
else
tvWatches.NodeText[VNode, COL_WATCH_VALUE-1]:= '<not evaluated>';
@ -1117,7 +1124,7 @@ end;
procedure TWatchesDlg.tvWatchesInitChildren(Sender: TBaseVirtualTree;
Node: PVirtualNode; var ChildCount: Cardinal);
var
VNdWatch, NewWatch: TIdeWatch;
VNdWatch: TIdeWatch;
WatchValue: TIdeWatchValue;
begin
ChildCount := 0;

View File

@ -632,7 +632,10 @@ type
procedure SaveDataToXMLConfig(const AConfig: TXMLConfig;
APath: string);
public
function Add(const AExpression: String): TIdeWatch;
{$IfOpt C+}
function Add: TCollectionItem; reintroduce;
{$EndIF}
function Add(const AExpression: String): TIdeWatch; virtual;
function Find(const AExpression: String): TIdeWatch; reintroduce;
property Items[const AnIndex: Integer]: TIdeWatch read GetItem write SetItem; default;
end;
@ -724,7 +727,7 @@ type
constructor Create(AMonitor: TIdeWatchesMonitor);
destructor Destroy; override;
// Watch
function Add(const AExpression: String): TCurrentWatch;
function Add(const AExpression: String): TCurrentWatch; override;
function Find(const AExpression: String): TCurrentWatch; reintroduce;
// IDE
procedure LoadFromXMLConfig(const AConfig: TXMLConfig; const APath: string);
@ -3230,7 +3233,6 @@ begin
FSnapShot.Clear;
for i := 0 to Count - 1 do begin
R := TIdeWatchValue.Create(FSnapShot.Watch);
R.Assign(EntriesByIdx[i]);
FSnapShot.Add(R);
TCurrentWatchValue(EntriesByIdx[i]).SnapShot := R;
end;
@ -5530,7 +5532,6 @@ begin
Result.SetParentWatch(Self);
Result.Enabled := Enabled;
Result.DisplayFormat := DisplayFormat;
//snapshot
EndChildUpdate;
end;
@ -5742,6 +5743,13 @@ begin
Items[i].SaveDataToXMLConfig(AConfig, APath + IntToStr(i) + '/');
end;
{$IfOpt C+}
function TIdeWatches.Add: TCollectionItem;
begin
assert(False, 'TIdeWatches.Add: False');
end;
{$EndIf}
function TIdeWatches.Find(const AExpression: String): TIdeWatch;
begin
Result := TIdeWatch(inherited Find(AExpression));
@ -5808,7 +5816,6 @@ begin
FSnapShot.Clear;
for i := 0 to Count - 1 do begin
R := FSnapShot.Add('');
R.Assign(Items[i]);
Items[i].SnapShot := R;
end;
end;