mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 13:49:12 +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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$ifndef FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||||
function CaptureBacktrace(skipframes,count:sizeint;frames:PCodePointer):sizeint;
|
function CaptureBacktrace(skipframes,count:sizeint;frames:PCodePointer):sizeint;
|
||||||
var
|
var
|
||||||
curr_frame,prev_frame: pointer;
|
curr_frame,prev_frame: pointer;
|
||||||
@ -1095,6 +1096,7 @@ begin
|
|||||||
else
|
else
|
||||||
result:=i;
|
result:=i;
|
||||||
end;
|
end;
|
||||||
|
{$endif FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||||
|
|
||||||
|
|
||||||
Procedure HandleErrorAddrFrame (Errno : longint;addr : CodePointer; frame : Pointer);[public,alias:'FPC_BREAK_ERROR']; {$ifdef CPUI386} register; {$endif}
|
Procedure HandleErrorAddrFrame (Errno : longint;addr : CodePointer; frame : Pointer);[public,alias:'FPC_BREAK_ERROR']; {$ifdef CPUI386} register; {$endif}
|
||||||
|
@ -213,6 +213,12 @@ type
|
|||||||
end;
|
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 }
|
{ 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;
|
function GetBacktrace(Context: TContext; StartingFrame: Pointer; out Frames: PPointer): Longint;
|
||||||
var
|
var
|
||||||
|
@ -31,6 +31,7 @@ interface
|
|||||||
{$ifdef FPC_USE_WIN64_SEH}
|
{$ifdef FPC_USE_WIN64_SEH}
|
||||||
{$define FPC_SYSTEM_HAS_RAISEEXCEPTION}
|
{$define FPC_SYSTEM_HAS_RAISEEXCEPTION}
|
||||||
{$define FPC_SYSTEM_HAS_RERAISE}
|
{$define FPC_SYSTEM_HAS_RERAISE}
|
||||||
|
{$define FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||||
{$endif FPC_USE_WIN64_SEH}
|
{$endif FPC_USE_WIN64_SEH}
|
||||||
|
|
||||||
{ include system-independent routine headers }
|
{ include system-independent routine headers }
|
||||||
|
Loading…
Reference in New Issue
Block a user