Graeme Geldenhuys schreef:
Hi,
I have ported the DUnit2 testing framework from Delphi to FPC. DUnit2
works perfectly under 32bit FPC, but I am getting a compiler error when
trying to compile DUnit2 with 64bit FPC. The error 'Unknown identifier
"EAX"' occurs in the first line of function CallerAddr(...).
I know that using ASM is not portable in FPC. CallerAddr() is used is
the raise <exception> at <address> call in method Fail(...) shown below.
Is there an existing function in FPC that does the same as
CallerAddr(..), but in a cross platform way? Alternatively, how can I
solve this compiler error under 64bit FPC (currently testing under 64bit
Linux).
There is http://lazarus-ccr.sourceforge.net/docs/rtl/system/get_caller_addr.html
It is used for example in LCLProc.GetStackTracePointers
bp:=get_caller_frame(get_frame);
if bp<>nil then
addr:=get_caller_addr(bp);
Vincent
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal