IdeDebugger: Watches, fix handling old "TDBGType" for expanding arrays

This commit is contained in:
Martin 2023-02-04 16:02:24 +01:00
parent dd5d291621
commit 24e9f48caa

View File

@ -1448,6 +1448,7 @@ var
ExistingNode, nd: PVirtualNode;
ChildInfo: TWatchResultDataFieldInfo;
AnchClass: String;
IsGdbmiArray: Boolean;
begin
ChildCount := 0;
@ -1500,12 +1501,16 @@ begin
AWatch := AWatchValue.Watch;
if (TypInfo <> nil) and (TypInfo.Fields <> nil) then begin
IsGdbmiArray := TypInfo.Attributes * [saDynArray, saArray] <> [];
ChildCount := TypInfo.Fields.Count;
ExistingNode := tvWatches.GetFirstChildNoInit(VNode);
AnchClass := TypInfo.TypeName;
for i := 0 to TypInfo.Fields.Count-1 do begin
NewWatch := AWatchValue.ChildrenByNameAsField[TypInfo.Fields[i].Name, AnchClass];
if IsGdbmiArray then
NewWatch := AWatchValue.ChildrenByNameAsArrayEntry[StrToInt64Def(TypInfo.Fields[i].Name, 0)]
else
NewWatch := AWatchValue.ChildrenByNameAsField[TypInfo.Fields[i].Name, AnchClass];
if NewWatch = nil then begin
dec(ChildCount);
continue;