+ return a small, fake backtrace for WebAssembly, so that in case of a runtime

error, the message 'Runtime error XXX at $EEEEEEEE' appears.
This commit is contained in:
Nikolay Nikolov 2021-10-05 04:44:52 +03:00
parent c0cec218d6
commit d9eb8d75b9

View File

@ -36,10 +36,24 @@ procedure Move(const source;var dest;count:SizeInt);[public, alias: 'FPC_MOVE'];
end;
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;
{$define FPC_SYSTEM_HAS_GET_PC_ADDR}
Function Get_pc_addr : CodePointer;
begin
result:=nil;
{ dummy, produces a small, fake backtrace, otherwise programs terminate
with no output at all, in case of a runtime error }
result:=CodePointer($eeeeeeef);
end;
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
function get_caller_addr(framebp:pointer;addr:codepointer=nil):pointer;
begin
{ dummy, produces a small, fake backtrace, otherwise programs terminate
with no output at all, in case of a runtime error }
if addr=CodePointer($eeeeeeef) then
result:=CodePointer($eeeeeeee)
else
result:=nil;
end;