-- Here's a sample interface to the Exception Interceptor. Package Exception_interceptor is Type Integer_array_type is array (Integer range <>) of Integer; Type Exception_array_type ( Length: Natural ) is record Data: Integer_array_type (1..Length); end record; Type Exception_array_pointer_type is access Exception_array_type; Type Frame_type is private; -- Now for the 4 subprograms... Function Enable return Frame_type; Procedure Disable; Procedure Retrieve ( Frame: in Frame_type; Signal_array: out Exception_array_pointer_type; Mechanism_array: out Exception_array_pointer_type ); Procedure Free ( Frame: in Frame_type ); private Type Frame_type is new Integer; Pragma Interface ( Macro, Enable ); Pragma Import_function ( Enable, Enable_exception_interceptor ); Pragma Interface ( Macro, Disable ); Pragma Import_procedure ( Disable, Disable_exception_interceptor ); Pragma Interface ( Macro, Retrieve ); Pragma Import_procedure ( Retrieve, Retrieve_exception_arrays, Mechanism=>( Value, Reference, Reference ) ); Pragma Interface ( Macro, Free ); Pragma Import_procedure ( Free, Free_interceptor_memory, Mechanism=>( Value ) ); end; -- Here's an example of the use of the Exception Interceptor. -- Step through this program in the debugger to see how it works. With Exception_interceptor; Use Exception_interceptor; Procedure Example is Frame: Frame_type; Signal_array, Mechanism_array: Exception_array_pointer_type; I, J: Integer; begin -- Enable the interceptor for this call frame. Frame := Exception_interceptor.Enable; -- Generate an exception... J := 0; I := I / J; -- If there weren't an exception, we would do this: Exception_interceptor.Disable; Return; exception when others => -- Get the arrays. Exception_interceptor.Retrieve ( Frame, Signal_array, Mechanism_array ); -- -- Now free the arrays. Exception_interceptor.Free ( Frame ); Return; end;