mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:09:25 +02:00
* 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:
parent
332679e28a
commit
c330f5080c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user