mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-28 13:53:42 +02:00
FpDebug: Experimental/IFDEF code for auto-deref pointer to structure
git-svn-id: trunk@61453 -
This commit is contained in:
parent
5cfa46a52f
commit
87642bb738
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user