Manual Page Result
0
Command: exception_intro | Section: 3 | Source: Digital UNIX | File: exception_intro.3.gz
exception_intro(3) Library Functions Manual exception_intro(3)
NAME
exception_intro, libexc - an overview of exception support supplied in
libexc.a.
DESCRIPTION
The exception mechanism used on DIGITAL UNIX requires no execution time
in user code. The only costs before an exception occurs are one-time
registering and deregistering of modules with the runtime exception
handling mechanism from the init and fini sections. This one-time cost
is a requirement to support shared objects.
After an exception, there are costs to find exception handling and un-
wind information for procedure activations on the stack. This model
assumes that exceptions are exceptional occurrences and they should not
cost anything until they occur. The exception system makes every effort
when an exception occurs to be as efficient as possible by using mecha-
nisms such as binary searches and software caches where applicable.
The routines in this section come from four sources, although these
routines might not have the same names as the routines in the sources:
ULTRIX libexc.a NT defined interfaces Calling Standard for Alpha Sys-
tems new routines required for this implementation
There may be multiple routines which do the same things but are sup-
ported for backward compatibility. The data structures are defined in
excpt(4), pdsc(4) and the Calling Standard for Alpha Systems .
If you have used the runtime procedure descriptor from ULTRIX libexc as
an opaque pointer, your code will port easily. If not, you must modify
field names to match the new data structures.
The exception system supports three basic services: unwinding access to
procedure specific information exception management
Unwinding support includes the ability to get a context, virtual and
actual unwinding of levels of procedure activations from the stack and
continuing execution in a handler or other user code. Some of the un-
wind routines also support invoking handlers as they unwind so that the
language or user can clean up items at particular procedure activa-
tions.
The routines that provide access to procedure specific information can
map an address anywhere in a routine to the routine's information.
This information includes enough data to cause an unwind or determine
if a routine handles an exception. Typically these routines take an
address and then binary search a compiler system-created table for an
entry covering the address. These routines also contain support for
multiple tables so that shared objects and runtime generated code can
participate in the exception system.
The exception management routines provide ways for languages or users
to raise exceptions or cause signals to raise exceptions. The excep-
tion management routines also provide the mechanism to dispatch the ex-
ceptions to the appropriate handlers. Typically, languages provide han-
dlers which determine if the user has specified a handler for a partic-
ular address and exception. In the case of structured exception han-
dling in C, the language specific handler invokes a routine containing
user supplied code to determine what action to take (see c_excpt(4) for
information on C-style structured exception handling). Language spe-
cific handlers can either handle the exception or return for some other
procedure activation to handle it.
The following routines are described in Section 3 reference pages:
tab(@); lfHB lfHB l l. _
Routine@Description
_
exc_continue@T{ Like longjmp(3) T}
exc_dispatch_exception@T{ Deliver exceptions to language handlers T}
exc_longjmp@T{ Like longjmp(3) except calls handlers for cleanup T}
exc_lookup_function_entry@T{ Map address to procedure information T}
exc_lookup_function_table_address@T{ Map address to table containing
procedure information T}
exc_lookup_gp@T{ Map address to GP value for a procedure T}
exc_raise_exception@T{ Raise exception given exception structure T}
exc_raise_status_exception@T{ Raise exception given exception code T}
exc_set_last_chance_handler@T{ Set user handler for unhandled excep-
tions T}
exc_unwind@T{ Actual unwind invoking cleanup handlers T}
__exc_last_chance@T{ Unhandled exception handler T}
exc_resume@T{ Like longjmp(3) T}
exception_dispatcher@T{ Take signal(2) arguments and raises exceptions
T}
exc_find_frame_ptr@T{ Returns static link of current activation T}
find_rpd@T{ Maps address to procedure information T}
exc_add_gp_range@T{ Register range of address for a GP value T}
exc_add_pc_range_table@T{ Register procedure information table T}
exc_remove_gp_range@T{ Deregister range of addresses for a GP value T}
exc_remove_pc_range_table@T{ Deregister procedure information table T}
exc_raise_signal_exception@T{ Take signal(2) arguments and raises ex-
ceptions T}
set_unhandled_exception@T{ Set user handler for unhandled exceptions T}
unwind@T{ Virtual unwind updating activation context T}
exc_virtual_unwind@T{ Virtual unwind updating activation context T}
_
See the IEEE routines in the RELATED INFORMATION section for informa-
tion on IEEE floating point exception support.
FILES
usr/ccs/lib/cmplrs/cc/libexc.a - exception handling library usr/in-
clude/excpt.h - include file usr/include/pdsc.h - include file usr/in-
clude/signal.h - include file usr/include/machine/fpu.h - include file
RELATED INFORMATION
Functions: exception_dispatcher(3), exc_lookup_function_entry(3), sig-
nal(2), sigaction(2), setjmp(3), exc_unwind(3), __exc_last_chance(3),
ieee(3).
Files: excpt(4), c_excpt(4), signal(4), pdsc(4).
Programmer's Guide.
Assembly Language Programmer's Guide.
Calling Standard for Alpha Systems. delim off
exception_intro(3)