* moved StopJmp buffer to fpcatch unit

This commit is contained in:
pierre 2002-03-20 14:48:27 +00:00
parent 47b7e5c5b6
commit 9d5e55dddd
2 changed files with 53 additions and 10 deletions

View File

@ -47,6 +47,18 @@ Const
Procedure EnableCatchSignals;
Procedure DisableCatchSignals;
{$ifdef DEBUG}
procedure Generate_SIGSEGV;
procedure Generate_SIGFPE;
{$endif DEBUG}
{$ifndef GABOR}
var
StopJmp : Jmp_Buf;
const
StopJmpValid : boolean = false;
{$endif}
Implementation
uses
@ -65,6 +77,28 @@ uses
Const
LastCtrlC : longint = 0;
{$ifdef DEBUG}
procedure Generate_SIGSEGV;
var
l : plongint;
begin
{ Force a SIGSEGV }
l:=$ffffffff;
l^:=1;
end;
procedure Generate_SIGFPE;
var
x,y : real;
begin
{ Force a SIGFPE }
y:=-5;
x:=sqrt(y);
end;
{$endif DEBUG}
{$ifdef HasSignal}
{$ifdef Unix}
Procedure CatchSignal(Sig : Integer);cdecl;
@ -195,7 +229,10 @@ end.
{
$Log$
Revision 1.3 2001-10-24 14:17:27 pierre
Revision 1.4 2002-03-20 14:48:27 pierre
* moved StopJmp buffer to fpcatch unit
Revision 1.3 2001/10/24 14:17:27 pierre
* try to fix the Win2000 mouse problem
Revision 1.2 2001/08/05 02:01:47 peter

View File

@ -125,12 +125,6 @@ procedure ParseUserScreen;
procedure RegisterFPCompile;
{$ifndef GABOR}
var
StopJmp : Jmp_Buf;
const
StopJmpValid : boolean = false;
{$endif}
implementation
@ -149,6 +143,9 @@ uses
{$ifdef win32}
signals,
{$endif}
{$ifdef HasSignal}
fpcatch,
{$endif HasSignal}
Dos,Video,
StdDlg,App,tokens,
{$ifdef FVISION}
@ -824,7 +821,9 @@ procedure DoCompile(Mode: TCompileMode);
var
s,FileName: string;
ErrFile : Text;
MustRestartDebugger : boolean;
MustRestartDebugger,
StoreStopJumpValid : boolean;
StoreStopJmp : Jmp_buf;
JmpRet,Error,LinkErrorCount : longint;
E : TEvent;
DummyView: PView;
@ -920,6 +919,8 @@ begin
WUtils.DeleteFile(GetExePath+PpasFile);
SetStatus('Compiling...');
{$ifndef GABOR}
StoreStopJumpValid:=StopJmpValid;
StoreStopJmp:=StopJmp;
StopJmpValid:=true;
JmpRet:=SetJmp(StopJmp);
if JmpRet=0 then
@ -956,7 +957,8 @@ begin
CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
SetStatus('Long jumped out of compilation...');
end;
StopJmpValid:=false;
StopJmpValid:=StoreStopJumpValid;
StopJmp:=StoreStopJmp;
{$endif}
{ tokens are created and distroyed by compiler.compile !! PM }
InitTokens;
@ -1238,6 +1240,7 @@ begin
begin
S^.Reset;
Dispose(S, Done);
S:=nil;
OK:=true;
end;
fileclose:=OK;
@ -1255,7 +1258,10 @@ end;
end.
{
$Log$
Revision 1.6 2001-11-13 01:58:34 carl
Revision 1.7 2002-03-20 14:48:27 pierre
* moved StopJmp buffer to fpcatch unit
Revision 1.6 2001/11/13 01:58:34 carl
* Range check error fix
Revision 1.5 2001/10/03 10:21:43 pierre