mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 11:30:35 +02:00
* SysUtils functions related to exceptions and stacktraces updated to use CodePointer
git-svn-id: trunk@25515 -
This commit is contained in:
parent
5973b231ec
commit
5e09b7a56f
@ -217,9 +217,9 @@ type
|
||||
|
||||
{ Exception handling routines }
|
||||
function ExceptObject: TObject;
|
||||
function ExceptAddr: Pointer;
|
||||
function ExceptAddr: CodePointer;
|
||||
function ExceptFrameCount: Longint;
|
||||
function ExceptFrames: PPointer;
|
||||
function ExceptFrames: PCodePointer;
|
||||
function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer;
|
||||
Buffer: PChar; Size: Integer): Integer;
|
||||
procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);
|
||||
|
@ -281,13 +281,16 @@ end;
|
||||
|
||||
{$push}
|
||||
{$S-}
|
||||
Procedure CatchUnhandledException (Obj : TObject; Addr: Pointer; FrameCount: Longint; Frames: PPointer);[public,alias:'FPC_BREAK_UNHANDLED_EXCEPTION'];
|
||||
Procedure CatchUnhandledException (Obj : TObject; Addr: CodePointer; FrameCount: Longint; Frames: PCodePointer);[public,alias:'FPC_BREAK_UNHANDLED_EXCEPTION'];
|
||||
Var
|
||||
i : longint;
|
||||
hstdout : ^text;
|
||||
begin
|
||||
hstdout:=@stdout;
|
||||
{$if defined(CPUI8086) and (defined(FPC_MM_MEDIUM) or defined(FPC_MM_LARGE) or defined(FPC_MM_HUGE))}
|
||||
{$else}
|
||||
Writeln(hstdout^,'An unhandled exception occurred at $',HexStr(Addr),':');
|
||||
{$endif}
|
||||
if Obj is exception then
|
||||
Writeln(hstdout^,Obj.ClassName,': ',Exception(Obj).Message)
|
||||
else
|
||||
@ -364,7 +367,7 @@ Var OutOfMemory : EOutOfMemory;
|
||||
InValidPointer : EInvalidPointer;
|
||||
|
||||
|
||||
Procedure RunErrorToExcept (ErrNo : Longint; Address,Frame : Pointer);
|
||||
Procedure RunErrorToExcept (ErrNo : Longint; Address : CodePointer; Frame : Pointer);
|
||||
var
|
||||
E: Exception;
|
||||
HS: PString;
|
||||
@ -495,7 +498,7 @@ begin
|
||||
Result:=RaiseList^.FObject;
|
||||
end;
|
||||
|
||||
function ExceptAddr: Pointer;
|
||||
function ExceptAddr: CodePointer;
|
||||
|
||||
begin
|
||||
If RaiseList=Nil then
|
||||
@ -513,7 +516,7 @@ begin
|
||||
Result:=RaiseList^.Framecount;
|
||||
end;
|
||||
|
||||
function ExceptFrames: PPointer;
|
||||
function ExceptFrames: PCodePointer;
|
||||
|
||||
begin
|
||||
If RaiseList=Nil then
|
||||
@ -565,7 +568,7 @@ end;
|
||||
procedure Abort;
|
||||
|
||||
begin
|
||||
Raise EAbort.Create(SAbortError) at Pointer(Get_Caller_addr(Get_Frame));
|
||||
Raise EAbort.Create(SAbortError) at CodePointer(Get_Caller_addr(Get_Frame));
|
||||
end;
|
||||
|
||||
procedure OutOfMemoryError;
|
||||
|
Loading…
Reference in New Issue
Block a user