mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 09:59:17 +02:00
* Win64: Use separate implementation of CaptureBacktrace that calls RtlCaptureStackBackTrace. This way it does not require non-optimized code to work correctly.
git-svn-id: trunk@29692 -
This commit is contained in:
parent
438c433c50
commit
d93d36e6d3
@ -1067,6 +1067,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{$ifndef FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||
function CaptureBacktrace(skipframes,count:sizeint;frames:PCodePointer):sizeint;
|
||||
var
|
||||
curr_frame,prev_frame: pointer;
|
||||
@ -1095,6 +1096,7 @@ begin
|
||||
else
|
||||
result:=i;
|
||||
end;
|
||||
{$endif FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||
|
||||
|
||||
Procedure HandleErrorAddrFrame (Errno : longint;addr : CodePointer; frame : Pointer);[public,alias:'FPC_BREAK_ERROR']; {$ifdef CPUI386} register; {$endif}
|
||||
|
@ -213,6 +213,12 @@ type
|
||||
end;
|
||||
|
||||
|
||||
function CaptureBacktrace(skipframes,count:sizeint;frames:PCodePointer):sizeint;
|
||||
begin
|
||||
{ skipframes is increased because this function adds a call level }
|
||||
Result:=RtlCaptureStackBackTrace(skipframes+1,count,frames^,nil);
|
||||
end;
|
||||
|
||||
{ note: context must be passed by value, so modifications are made to a local copy }
|
||||
function GetBacktrace(Context: TContext; StartingFrame: Pointer; out Frames: PPointer): Longint;
|
||||
var
|
||||
|
@ -31,6 +31,7 @@ interface
|
||||
{$ifdef FPC_USE_WIN64_SEH}
|
||||
{$define FPC_SYSTEM_HAS_RAISEEXCEPTION}
|
||||
{$define FPC_SYSTEM_HAS_RERAISE}
|
||||
{$define FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||
{$endif FPC_USE_WIN64_SEH}
|
||||
|
||||
{ include system-independent routine headers }
|
||||
|
Loading…
Reference in New Issue
Block a user