[fpc-pascal] Help with Delphi ASM translation to FPC

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Mar 13 01:03:18 CET 2015


On 2015-03-12 23:15, Graeme Geldenhuys wrote:
> // FPC cross-platform implementation
> function CallerAddr: Pointer;
> begin
>   Result := get_caller_addr(get_frame);
> end;

I was told from another source my FPC implementation was incorrect and
should rather be:

[Anybody that could explain the different to me? I would be very grateful.]

function CallerAddr: Pointer;
var
  bp: Pointer;
begin
  bp := get_caller_frame(get_frame);
  if bp <> nil then
    Result := get_caller_addr(bp)
  else
    Result := nil;
end;

This now does cause different addresses for various unit test failures.
Next part is to extract the line info information to confirm that the
addresses I now see are indeed correct.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/



More information about the fpc-pascal mailing list