home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / standard / exception.z / exception
Encoding:
Text File  |  1998-10-30  |  6.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. EEEEXXXXCCCCEEEEPPPPTTTTIIIIOOOONNNN((((3333CCCC))))                                                    EEEEXXXXCCCCEEEEPPPPTTTTIIIIOOOONNNN((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      exc_resume, exc_setjmp, find_fde, find_fde_name, exc_unwind,
  10.      exc_unwind_name - exception handling facility
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<eeeexxxxcccceeeeppppttttiiiioooonnnn....hhhh>>>>
  14.  
  15.      ####iiiiffff ((((ddddeeeeffffiiiinnnneeeedddd((((____LLLLAAAANNNNGGGGUUUUAAAAGGGGEEEE____CCCC)))) |||||||| ddddeeeeffffiiiinnnneeeedddd((((____LLLLAAAANNNNGGGGUUUUAAAAGGGGEEEE____CCCC____PPPPLLLLUUUUSSSS____PPPPLLLLUUUUSSSS))))))))
  16.      DDDDwwwwaaaarrrrffff____FFFFddddeeee
  17.      ffffiiiinnnndddd____ffffddddeeee((((lllloooonnnngggg ppppcccc))));;;;
  18.  
  19.      DDDDwwwwaaaarrrrffff____FFFFddddeeee
  20.      ffffiiiinnnndddd____ffffddddeeee____nnnnaaaammmmeeee((((lllloooonnnngggg ppppcccc,,,, cccchhhhaaaarrrr ********nnnnaaaammmmeeee))));;;;
  21.  
  22.      vvvvooooiiiidddd eeeexxxxcccc____uuuunnnnwwwwiiiinnnndddd((((ssssttttrrrruuuucccctttt ssssiiiiggggccccoooonnnntttteeeexxxxtttt ****ssssccccpppp,,,, DDDDwwwwaaaarrrrffff____FFFFddddeeee ffffddddeeee))));;;;
  23.  
  24.      vvvvooooiiiidddd eeeexxxxcccc____uuuunnnnwwwwiiiinnnndddd____nnnnaaaammmmeeee((((ssssttttrrrruuuucccctttt ssssiiiiggggccccoooonnnntttteeeexxxxtttt ****ssssccccpppp,,,, DDDDwwwwaaaarrrrffff____FFFFddddeeee ffffddddeeee,,,, cccchhhhaaaarrrr ********nnnnaaaammmmeeee))));;;;
  25.  
  26.      iiiinnnntttt eeeexxxxcccc____rrrreeeessssuuuummmmeeee((((ssssttttrrrruuuucccctttt ssssiiiiggggccccoooonnnntttteeeexxxxtttt ****ssssccccpppp))));;;;
  27.  
  28.      vvvvooooiiiidddd eeeexxxxcccc____sssseeeettttjjjjmmmmpppp((((ssssttttrrrruuuucccctttt ssssiiiiggggccccoooonnnntttteeeexxxxtttt ****ssssccccpppp))));;;;
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      NOTE:  this version (4.0) of exception handling facility is totally
  32.      different from the (3.xx) versions.  This version extracts information
  33.      from the ._d_e_b_u_g__f_r_a_m_e section instead of the _r_u_n_t_i_m_e _p_r_o_c_e_d_u_r_e _t_a_b_l_e as
  34.      in the prior releases.  All the old functions -- exception_dispatcher,
  35.      find_rpd, set_unhandled_exception and unwind -- are no longer supported.
  36.  
  37.      To handle exceptions from UNIX signals and to minimize the cost at
  38.      runtime until an exception is encountered, the loader collects per-
  39.      procedure exception information and frame information so that the stack
  40.      unwinds easily at the point of exception.
  41.  
  42.      The data structure _D_w_a_r_f__F_d_e is specified in the (._d_e_b_u_g__f_r_a_m_e) section.
  43.      Please refer to the _D_W_A_R_F _D_e_b_u_g_g_i_n_g _I_n_f_o_r_m_a_t_i_o_n _F_o_r_m_a_t for more details.
  44.  
  45.      At runtime the following procedures will be provided in _l_i_b_e_x_c._s_o:
  46.  
  47.      _f_i_n_d__f_d_e will return the Frame Description Entry(FDE) specified by the pc
  48.      argument, if there is one, otherwise it will return NULL.
  49.  
  50.      _f_i_n_d__f_d_e__n_a_m_e does the same thing as _f_i_n_d__f_d_e but in addition returns the
  51.      name of the procedure through the parameter _n_a_m_e.
  52.  
  53.      _e_x_c__u_n_w_i_n_d will take the sigcontext scp argument and virtually unwind by
  54.      changing the fields to reflect the next frame on the stack.  A _s_i_g_r_e_t_u_r_n
  55.      call can be called with this scp upon return and will return to the frame
  56.      unwind set up.  The fde argument is used as the Frame Description Entry
  57.      argument.  If it is NULL, _e_x_c__u_n_w_i_n_d will call _f_i_n_d__f_d_e on scp->sc_pc to
  58.      get it.  If _e_x_c__u_n_w_i_n_d is unable to unwind the stack, it will set the
  59.      _s_c__p_c field of the _s_c_p parameter to 1, indicating invalid address.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. EEEEXXXXCCCCEEEEPPPPTTTTIIIIOOOONNNN((((3333CCCC))))                                                    EEEEXXXXCCCCEEEEPPPPTTTTIIIIOOOONNNN((((3333CCCC))))
  71.  
  72.  
  73.  
  74.      _e_x_c__u_n_w_i_n_d__n_a_m_e does the same thing as _e_x_c__u_n_w_i_n_d but in addition returns
  75.      the name of the procedure of the current sigcontext through the parameter
  76.      _n_a_m_e.
  77.  
  78.      _e_x_c__s_e_t_j_m_p is like setjmp, except that it saves V0 and also sets a
  79.      special magic number so that exc_resume can tell which degree of
  80.      restoration is required.
  81.  
  82.      _e_x_c__r_e_s_u_m_e is like longjmp, except that it restores the v0 that
  83.      _e_x_c__s_e_t_j_m_p saved and performs one of the three different degress of
  84.      restoration, according to the magic number in the sigcontext.
  85.  
  86. UUUUSSSSAAAAGGGGEEEE
  87.           cc  main.o -lexc -ldwarf -lelf
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.