Browse Source

+ Added support for ExceptProc+

michael 27 years ago
parent
commit
d207893bde
2 changed files with 15 additions and 7 deletions
  1. 5 5
      rtl/inc/except.inc
  2. 10 2
      rtl/objpas/objpas.pp

+ 5 - 5
rtl/inc/except.inc

@@ -117,7 +117,6 @@ begin
 {$ifdef excdebug}
 {$ifdef excdebug}
   writeln ('In Popaddrstack');
   writeln ('In Popaddrstack');
 {$endif}
 {$endif}
-
   If ExceptAddrStack=nil then
   If ExceptAddrStack=nil then
     begin
     begin
     writeln ('At end of ExceptionAddresStack');
     writeln ('At end of ExceptionAddresStack');
@@ -133,7 +132,6 @@ begin
 {$ifdef excdebug}
 {$ifdef excdebug}
   writeln ('In PopObjectstack');
   writeln ('In PopObjectstack');
 {$endif}
 {$endif}
-
   If ExceptObjectStack=nil then
   If ExceptObjectStack=nil then
     begin
     begin
     writeln ('At end of ExceptionObjectStack');
     writeln ('At end of ExceptionObjectStack');
@@ -149,12 +147,14 @@ begin
 {$ifdef excdebug}
 {$ifdef excdebug}
   writeln ('In reraise');
   writeln ('In reraise');
 {$endif}
 {$endif}
-
   PopAddrStack;
   PopAddrStack;
   If ExceptAddrStack=Nil then
   If ExceptAddrStack=Nil then
     begin
     begin
-    writeln ('Re-Raise : At end of address chain.');
-    halt (1);
+    If ExceptProc<>Nil then
+      If ExceptObjectStack<>Nil then
+        TExceptPRoc(ExceptProc)(ExceptObjectStack^.FObject,
+                                ExceptObjectStack^.Addr);
+    RunError(217);
     end;
     end;
   longjmp(ExceptAddrStack^.Buf^,FPC_Exception);
   longjmp(ExceptAddrStack^.Buf^,FPC_Exception);
 end;
 end;

+ 10 - 2
rtl/objpas/objpas.pp

@@ -75,9 +75,14 @@ unit objpas;
           function safecallexception(exceptobject : tobject;
           function safecallexception(exceptobject : tobject;
             exceptaddr : pointer) : integer;virtual;
             exceptaddr : pointer) : integer;virtual;
        end;
        end;
-
+       
+       TExceptProc = Procedure (Obj : TObject; Addr: Pointer);
+       
        var
        var
           abstracterrorproc : pointer;
           abstracterrorproc : pointer;
+       Const
+          ExceptProc : Pointer {TExceptProc} = Nil;
+          
 
 
   implementation
   implementation
 
 
@@ -279,7 +284,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-07-29 15:44:33  michael
+  Revision 1.5  1998-07-30 16:10:11  michael
+  + Added support for ExceptProc+
+
+  Revision 1.4  1998/07/29 15:44:33  michael
    included sysutils and math.pp as target. They compile now.
    included sysutils and math.pp as target. They compile now.
 
 
   Revision 1.3  1998/07/29 10:09:28  michael
   Revision 1.3  1998/07/29 10:09:28  michael