FpDebug: Experimental/IFDEF code for auto-deref pointer to structure

git-svn-id: trunk@61453 -
This commit is contained in:
martin 2019-06-23 11:14:27 +00:00
parent 5cfa46a52f
commit 87642bb738

View File

@ -2942,6 +2942,20 @@ begin
tmp := Items[0].ResultValue;
if (tmp = nil) then exit;
{$IFDEF FpDebugAutoDerefMember}
// Copy from TFpPascalExpressionPartOperatorDeRef.DoGetResultValue
if tmp.Kind = skPointer then begin
if (svfDataAddress in tmp.FieldFlags) and (IsReadableLoc(tmp.DataAddress)) and // TODO, what if Not readable addr
(tmp.TypeInfo <> nil) //and (tmp.TypeInfo.TypeInfo <> nil)
then
tmp := tmp.Member[0];
if (tmp = nil) then begin
SetError(fpErrCannotDereferenceType, [Items[0].GetText]); // TODO: better error
exit;
end;
end;
{$ENDIF}
if (tmp.Kind in [skClass, skRecord, skObject]) then begin
Result := tmp.MemberByName[Items[1].GetText];
if Result = nil then begin