From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_20,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4d683283fc9bfdf1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-11 19:54:02 PST Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!ctcvax.ccf.swri.edu!trident!tim Newsgroups: comp.lang.ada Subject: Exception handler question Message-ID: <318@trident.datasys.swri.edu> From: tim@trident.datasys.swri.edu (Timothy J. Barton) Date: 11 Mar 93 20:17:34 GMT Organization: Southwest Research Institute Summary: How to trap "range check" Date: 1993-03-11T20:17:34+00:00 List-Id: Please help me in my ignorance of Ada exception handlers. I am using Sun Ada and am trying to trap the usage of an out of range value being passed to another program unit. I have an exception handler with "when CONSTRAINT_ERROR" and "when others", but the exception handler is not getting called. When I run the program in the Sun Ada debugger, I get the message: "Illegal instruction" [4] Software trap: range check Program execution is halted, I can't single step any further. In other cases where I trap an exception, a single step would take me to the exception hanlder source lines. If I run the program outside the debugger, very bad things happen (and happen so fast I can't read the message which flashes by) and then my program and xterm go away. Program looks like the following: --------------------------------- subtype COLUMN is INTEGER range 0..100; procedure example is begin OtherFunction( COLUMN(101) ); -- CONSTRAINT error here! exception when CONSTRAINT_ERROR => do something when others => do something end example; --------------------------------- What am I doing wrong? Why doesn't my exception handler get called? Any help would be greatly appreciated. ---------------------------------------------------------------------------- Timothy J. Barton tim@trident.datasys.swri.edu Senior Research Analyst (210) 522-3540 Southwest Research Institute (SwRI) (210) 522-5499 (Fax) San Antonio, Texas 78228-0510