exception(3C)
exc_resume, exc_setjmp, find_fde, find_fde_name, exc_unwind, exc_unwind_name - Exception handling facility
As shipped in IRIX 6.5.15. Last changed in IRIX 6.5.5.
NAME exc_resume, exc_setjmp, find_fde, find_fde_name, exc_unwind, exc_unwind_name - Exception handling facility SYNOPSIS #include <exception.h> #if (defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)) #if (_MIPS_SIM == _MIPS_SIM_NABI32) Dwarf_Fde find_fde(long pc); Dwarf_Fde find_fde(Elf32_Addr *pc); Dwarf_Fde find_fde_name(Elf32_Addr *pc, char **name); #else /* if (_MIPS_SIM == _MIPS_SIM_ABI64) */ Dwarf_Fde find_fde(Elf64_Addr *pc); Dwarf_Fde find_fde_name(Elf64_Addr *pc, char **name); #endif void exc_unwind(struct sigcontext *scp, Dwarf_Fde fde); void exc_unwind_name(struct sigcontext *scp, Dwarf_Fde fde, char **name); int exc_resume(struct sigcontext *scp); void exc_setjmp(struct sigcontext *scp); IMPLEMENTATION IRIX systems DESCRIPTION NOTE: This version (4.0) of exception handling facility is totally different from the (3.xx) versions. This version extracts information from the .debug_frame section instead of the runtime procedure table as in the prior releases. The old functions (exception_dispatcher, find_rpd, set_unhandled_exception and unwind) are no longer supported. To handle exceptions from UNIX signals and to minimize the cost at runtime until an exception is encountered, the loader collects per- procedure exception information and frame information so that the stack unwinds easily at the point of exception. The data structure Dwarf_Fde is specified in the (.debug_frame) section. See the dwarf(4) man page for additional information. At runtime the following procedures will be provided in libexc.so: find_fde will return the Frame Description Entry(FDE) specified by the pc argument, if there is one, otherwise it will return NULL. find_fde_name does the same thing as find_fde but in addition returns the name of the procedure through the parameter name. Use free to deallocate the returned strings after they are used. (See the free(3C) man page for details on its use.) exc_unwind will take the sigcontext scp argument and virtually unwind by changing the fields to reflect the next frame on the stack. A sigreturn call can be called with this scp upon return and will return to the frame unwind set up. The fde argument is used as the Frame Description Entry argument. If it is NULL, exc_unwind will call find_fde on scp->sc_pc to get it. If exc_unwind is unable to unwind the stack, it will set the sc_pc field of the scp parameter to 1, indicating invalid address. exc_unwind_name does the same thing as exc_unwind but in addition returns the name of the procedure of the current sigcontext through the parameter name. Use free to deallocate the returned strings after they are used. (See the free(3C) man page for details on its use.) exc_setjmp is like setjmp, except that it saves V0 and also sets a special magic number so that exc_resume can tell which degree of restoration is required. exc_resume is like longjmp, except that it restores the v0 that exc_setjmp saved and performs one of the three different degress of restoration, according to the magic number in the sigcontext. EXAMPLES cc main.o -lexc -ldwarf -lelf SEE ALSO free(3C), libexc(3), malloc(3C) dwarf(4) This man page is available only online.