FpDebug: allow calling functions from function-pointer variables. (Not yet method variables)

This commit is contained in:
Martin 2023-02-12 21:30:15 +01:00
parent 9569f7beff
commit 57da4cd7fd
2 changed files with 7 additions and 4 deletions

View File

@ -1197,9 +1197,12 @@ begin
Result := InvalidLoc;
if (FDataSymbol = nil) then
exit;
assert(FDataSymbol is TFpSymbolDwarfDataProc, 'TFpValueDwarfSubroutine.GetEntryPCAddress: FDataSymbol is TFpSymbolDwarfDataProc');
if not TFpSymbolDwarfDataProc(FDataSymbol).GetEntryPCAddress(Self, Result) then
Result := InvalidLoc;
if FDataSymbol is TFpSymbolDwarfDataProc then begin
if not TFpSymbolDwarfDataProc(FDataSymbol).GetEntryPCAddress(Self, Result) then
Result := InvalidLoc;
end
else
Result := DataAddress;
end;
{ TFpDwarfDefaultSymbolClassMap }

View File

@ -1654,7 +1654,7 @@ begin
if (tmp = nil) or (not Expression.Valid) then
exit;
if (tmp.DbgSymbol <> nil) and (tmp.DbgSymbol.Kind = skFunction) then begin
if (tmp.DbgSymbol <> nil) and (tmp.DbgSymbol.Kind in [skFunction, skFunctionRef]) then begin
if not Assigned(Expression.OnFunctionCall) then begin
SetError('calling functions not allowed');
exit;