Browse Source

* avoid longjmp messages if quitting after compilation error

pierre 22 years ago
parent
commit
8aca5d924f
3 changed files with 31 additions and 5 deletions
  1. 14 4
      ide/fpcompil.pas
  2. 15 0
      ide/test.pas
  3. 2 1
      ide/test2.pas

+ 14 - 4
ide/fpcompil.pas

@@ -661,12 +661,15 @@ begin
   CompilerStatus:=false;
   CompilerStatus:=false;
 end;
 end;
 
 
+const
+  LONGJMPCALLED = -1;
+
 procedure CompilerStop; {$ifndef FPC}far;{$endif}
 procedure CompilerStop; {$ifndef FPC}far;{$endif}
 begin
 begin
 {$ifndef GABOR}
 {$ifndef GABOR}
 {$ifdef HasSignal}
 {$ifdef HasSignal}
   if StopJmpValid then
   if StopJmpValid then
-    Longjmp(StopJmp,1)
+    Longjmp(StopJmp,LONGJMPCALLED)
   else
   else
     Halt(1);
     Halt(1);
 {$endif}
 {$endif}
@@ -988,6 +991,7 @@ begin
       Inc(status.errorCount);
       Inc(status.errorCount);
 {$ifdef HasSignal}
 {$ifdef HasSignal}
       Case JmpRet of
       Case JmpRet of
+        LONGJMPCALLED : s:='Error';
         SIGINT : s := 'Interrupted by Ctrl-C';
         SIGINT : s := 'Interrupted by Ctrl-C';
         SIGILL : s := 'Illegal instruction';
         SIGILL : s := 'Illegal instruction';
         SIGSEGV : s := 'Signal Segmentation violation';
         SIGSEGV : s := 'Signal Segmentation violation';
@@ -997,8 +1001,11 @@ begin
       end;
       end;
       CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0);
       CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0);
 {$endif HasSignal}
 {$endif HasSignal}
-      CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
-      SetStatus('Long jumped out of compilation...');
+      if JmpRet<>LONGJMPCALLED then
+        begin
+          CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
+          SetStatus('Long jumped out of compilation...');
+        end;
     end;
     end;
 {$ifdef HasSignal}
 {$ifdef HasSignal}
   StopJmpValid:=StoreStopJumpValid;
   StopJmpValid:=StoreStopJumpValid;
@@ -1315,7 +1322,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2002-11-20 17:35:00  pierre
+  Revision 1.18  2002-12-02 13:58:29  pierre
+   * avoid longjmp messages if quitting after compilation error
+
+  Revision 1.17  2002/11/20 17:35:00  pierre
    * use target_os.ExeExt for compiled executable
    * use target_os.ExeExt for compiled executable
 
 
   Revision 1.16  2002/10/23 19:19:40  hajny
   Revision 1.16  2002/10/23 19:19:40  hajny

+ 15 - 0
ide/test.pas

@@ -157,7 +157,22 @@ var i : longint;
     Length : longint;
     Length : longint;
 
 
 BEGIN
 BEGIN
+{$ifdef m68k}
+  asm
+    beq	@L13
+    bhi @L13
+    blo @L13
+    dbeq d0,@L13
+    dbcs d0,@L13
+ //   dblo d0,@L13
+@L13:
+  end;
+{$endif}
   ClassVar1:=TClass2.create;
   ClassVar1:=TClass2.create;
+  Obj1.Init;
+  pointer2:=@Obj1;
+  Writeln('Obj1.Z=',Obj1.Z);
+  Obj1.done;
   X:=nil;
   X:=nil;
   // fg
   // fg
   for i:=1 to 2000 do
   for i:=1 to 2000 do

+ 2 - 1
ide/test2.pas

@@ -21,7 +21,8 @@ function IsOdd(X: integer): boolean;
 var Z: byte;
 var Z: byte;
 begin
 begin
   Z:=0;
   Z:=0;
-  X:=Z*X{$ifdef i386}*Test8087{$endif};
+  X:=Z*X{$ifdef cpui386}*
+   Test8087{$endif};
   IsOdd:=(X mod 2)=1;
   IsOdd:=(X mod 2)=1;
 end;
 end;