* replaced fpcunit custom code to obtaining a caller site with a call to

CaptureBacktrace (prevents crashes when compiled with LLVM backend,
    and is generally more robust)

git-svn-id: trunk@42093 -
This commit is contained in:
Jonas Maebe 2019-05-18 18:41:29 +00:00
parent 332679e28a
commit c330f5080c

View File

@ -376,16 +376,14 @@ Const
function CallerAddr: Pointer;
Var
bp,pcaddr : pointer;
address: CodePointer;
nframes: sizeint;
begin
Result:=Nil;
bp:=get_frame;
pcaddr:=get_pc_addr;
get_caller_stackinfo(bp,pcaddr);
if bp<>Nil then
get_caller_stackinfo(bp,pcaddr);
result:=pcaddr;
nframes:=CaptureBacktrace(2,1,@address);
if nframes=1 then
result:=address
else
result:=nil;
end;
function AddrsToStr(Addrs: Pointer): string;