* 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; function CallerAddr: Pointer;
Var Var
bp,pcaddr : pointer; address: CodePointer;
nframes: sizeint;
begin begin
Result:=Nil; nframes:=CaptureBacktrace(2,1,@address);
bp:=get_frame; if nframes=1 then
pcaddr:=get_pc_addr; result:=address
get_caller_stackinfo(bp,pcaddr); else
if bp<>Nil then result:=nil;
get_caller_stackinfo(bp,pcaddr);
result:=pcaddr;
end; end;
function AddrsToStr(Addrs: Pointer): string; function AddrsToStr(Addrs: Pointer): string;