Home | History | Annotate | Line # | Download | only in libunwind
libunwind.cxx revision 1.8.8.3
      1  1.8.8.2       tls //===--------------------------- libuwind.cpp -----------------------------===//
      2  1.8.8.2       tls //
      3  1.8.8.2       tls //                     The LLVM Compiler Infrastructure
      4  1.8.8.2       tls //
      5  1.8.8.2       tls // This file is dual licensed under the MIT and the University of Illinois Open
      6  1.8.8.2       tls // Source Licenses. See LICENSE.TXT for details.
      7  1.8.8.2       tls //
      8  1.8.8.2       tls //
      9  1.8.8.2       tls // Implements C++ ABI Exception Handling Level 1 as documented at:
     10  1.8.8.2       tls //      http://mentorembedded.github.io/cxx-abi/abi-eh.html
     11  1.8.8.2       tls //
     12  1.8.8.2       tls //===----------------------------------------------------------------------===//
     13  1.8.8.2       tls 
     14  1.8.8.3  jdolecek #define _UNWIND_GCC_EXTENSIONS
     15  1.8.8.3  jdolecek 
     16  1.8.8.2       tls #include <unwind.h>
     17  1.8.8.2       tls 
     18  1.8.8.2       tls #include "UnwindCursor.hpp"
     19  1.8.8.2       tls 
     20  1.8.8.2       tls using namespace _Unwind;
     21  1.8.8.2       tls 
     22  1.8.8.2       tls typedef CFI_Parser<LocalAddressSpace, NativeUnwindRegisters> MyCFIParser;
     23  1.8.8.2       tls 
     24  1.8.8.2       tls // Internal object representing the address space of this process.
     25  1.8.8.2       tls static LocalAddressSpace sThisAddressSpace(MyCFIParser::findPCRange);
     26  1.8.8.2       tls 
     27  1.8.8.2       tls typedef UnwindCursor<LocalAddressSpace, NativeUnwindRegisters> ThisUnwindCursor;
     28  1.8.8.2       tls 
     29  1.8.8.2       tls static _Unwind_Reason_Code unwind_phase1(ThisUnwindCursor &cursor,
     30  1.8.8.2       tls                                          struct _Unwind_Exception *exc) {
     31  1.8.8.2       tls   cursor.setInfoBasedOnIPRegister();
     32  1.8.8.2       tls 
     33  1.8.8.2       tls   // Walk frames looking for a place to stop.
     34  1.8.8.2       tls   for (;;) {
     35  1.8.8.2       tls     // Get next frame.
     36  1.8.8.2       tls     // First frame is _Unwind_RaiseException and skipped.
     37  1.8.8.2       tls     switch (cursor.step()) {
     38  1.8.8.2       tls     case UNW_STEP_END:
     39  1.8.8.2       tls       return _URC_END_OF_STACK;
     40  1.8.8.2       tls     case UNW_STEP_FAILED:
     41  1.8.8.2       tls       return _URC_FATAL_PHASE1_ERROR;
     42  1.8.8.2       tls     case UNW_STEP_SUCCESS:
     43  1.8.8.2       tls       break;
     44  1.8.8.2       tls     }
     45  1.8.8.2       tls 
     46  1.8.8.2       tls     // Check if there is a personality routine for this frame.
     47  1.8.8.2       tls     unw_proc_info_t frameInfo;
     48  1.8.8.2       tls     cursor.getInfo(&frameInfo);
     49  1.8.8.2       tls     if (frameInfo.end_ip == 0)
     50  1.8.8.2       tls       return _URC_FATAL_PHASE1_ERROR;
     51  1.8.8.2       tls 
     52  1.8.8.2       tls     if (frameInfo.handler == 0)
     53  1.8.8.2       tls       continue; // No personality routine, so try next frame.
     54  1.8.8.2       tls 
     55  1.8.8.2       tls     __personality_routine p = (__personality_routine)(frameInfo.handler);
     56  1.8.8.2       tls     _Unwind_Reason_Code result = (*p)(1, _UA_SEARCH_PHASE, exc->exception_class,
     57  1.8.8.2       tls                                       exc, (struct _Unwind_Context *)(&cursor));
     58  1.8.8.2       tls 
     59  1.8.8.2       tls     switch (result) {
     60  1.8.8.2       tls     case _URC_HANDLER_FOUND:
     61  1.8.8.2       tls       // This is either a catch clause or a local variable
     62  1.8.8.2       tls       // with destructor.
     63  1.8.8.2       tls       // Stop search and remember the frame for phase 2.
     64  1.8.8.2       tls       exc->private_2 = cursor.getSP();
     65  1.8.8.2       tls       return _URC_NO_REASON;
     66  1.8.8.2       tls 
     67  1.8.8.2       tls     case _URC_CONTINUE_UNWIND:
     68  1.8.8.2       tls       // Continue unwinding
     69  1.8.8.2       tls       break;
     70  1.8.8.2       tls 
     71  1.8.8.2       tls     default:
     72  1.8.8.2       tls       // Bad personality routine.
     73  1.8.8.2       tls       return _URC_FATAL_PHASE1_ERROR;
     74  1.8.8.2       tls     }
     75  1.8.8.2       tls   }
     76  1.8.8.2       tls }
     77  1.8.8.2       tls 
     78  1.8.8.2       tls static _Unwind_Reason_Code unwind_phase2(ThisUnwindCursor &cursor,
     79  1.8.8.2       tls                                          struct _Unwind_Exception *exc) {
     80  1.8.8.2       tls   cursor.setInfoBasedOnIPRegister();
     81  1.8.8.2       tls 
     82  1.8.8.2       tls   // Walk frames until the frame selected in phase 1 is reached.
     83  1.8.8.2       tls   for (;;) {
     84  1.8.8.2       tls     // Get next frame.
     85  1.8.8.2       tls     // First frame is _Unwind_RaiseException and skipped.
     86  1.8.8.2       tls     switch (cursor.step()) {
     87  1.8.8.2       tls     case UNW_STEP_END:
     88  1.8.8.2       tls       return _URC_END_OF_STACK;
     89  1.8.8.2       tls     case UNW_STEP_FAILED:
     90  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
     91  1.8.8.2       tls     case UNW_STEP_SUCCESS:
     92  1.8.8.2       tls       break;
     93  1.8.8.2       tls     }
     94  1.8.8.2       tls 
     95  1.8.8.2       tls     unw_proc_info_t frameInfo;
     96  1.8.8.2       tls     cursor.getInfo(&frameInfo);
     97  1.8.8.2       tls     if (frameInfo.end_ip == 0)
     98  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
     99  1.8.8.2       tls 
    100  1.8.8.2       tls     if (frameInfo.handler == 0)
    101  1.8.8.2       tls       continue; // No personality routine, continue.
    102  1.8.8.2       tls 
    103  1.8.8.2       tls     uintptr_t sp = cursor.getSP();
    104  1.8.8.2       tls 
    105  1.8.8.2       tls     _Unwind_Action action = _UA_CLEANUP_PHASE;
    106  1.8.8.2       tls     // If this frame was selected in phase 1,
    107  1.8.8.2       tls     // inform the personality routine.
    108  1.8.8.2       tls     if (sp == exc->private_2)
    109  1.8.8.2       tls       action = (_Unwind_Action)(action | _UA_HANDLER_FRAME);
    110  1.8.8.2       tls     __personality_routine p = (__personality_routine)(frameInfo.handler);
    111  1.8.8.2       tls     _Unwind_Reason_Code result = (*p)(1, action, exc->exception_class, exc,
    112  1.8.8.2       tls                                       (struct _Unwind_Context *)(&cursor));
    113  1.8.8.2       tls     switch (result) {
    114  1.8.8.2       tls     case _URC_CONTINUE_UNWIND:
    115  1.8.8.2       tls       // Continue unwinding unless the selected frame passed.
    116  1.8.8.2       tls       if (sp == exc->private_2)
    117  1.8.8.2       tls         return _URC_FATAL_PHASE2_ERROR;
    118  1.8.8.2       tls       break;
    119  1.8.8.2       tls     case _URC_INSTALL_CONTEXT:
    120  1.8.8.2       tls       // Transfer control to landing pad.
    121  1.8.8.2       tls       cursor.jumpto();
    122  1.8.8.2       tls     default:
    123  1.8.8.2       tls       // Bad personality routine.
    124  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
    125  1.8.8.2       tls     }
    126  1.8.8.2       tls   }
    127  1.8.8.2       tls }
    128  1.8.8.2       tls 
    129  1.8.8.2       tls static _Unwind_Reason_Code unwind_phase2_forced(ThisUnwindCursor &cursor,
    130  1.8.8.2       tls                                                 struct _Unwind_Exception *exc,
    131  1.8.8.2       tls                                                 _Unwind_Stop_Fn stop,
    132  1.8.8.2       tls                                                 void *stop_arg) {
    133  1.8.8.2       tls   _Unwind_Action action;
    134  1.8.8.2       tls   cursor.setInfoBasedOnIPRegister();
    135  1.8.8.2       tls 
    136  1.8.8.2       tls   // Walk frames until the frame selected in phase 1 is reached.
    137  1.8.8.2       tls   for (;;) {
    138  1.8.8.2       tls     // Get next frame.
    139  1.8.8.2       tls     // First frame is _Unwind_RaiseException and skipped.
    140  1.8.8.2       tls     switch (cursor.step()) {
    141  1.8.8.2       tls     case UNW_STEP_END:
    142  1.8.8.2       tls     case UNW_STEP_FAILED:
    143  1.8.8.2       tls       // End of stack or error condition.
    144  1.8.8.2       tls       // Call the stop function one last time.
    145  1.8.8.2       tls       action = (_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE |
    146  1.8.8.2       tls                                 _UA_END_OF_STACK);
    147  1.8.8.2       tls       (*stop)(1, action, exc->exception_class, exc,
    148  1.8.8.2       tls               (struct _Unwind_Context *)(&cursor), stop_arg);
    149  1.8.8.2       tls 
    150  1.8.8.2       tls       // Didn't stop at the expected frame, so return error.
    151  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
    152  1.8.8.2       tls 
    153  1.8.8.2       tls     case UNW_STEP_SUCCESS:
    154  1.8.8.2       tls       break;
    155  1.8.8.2       tls     }
    156  1.8.8.2       tls 
    157  1.8.8.2       tls     unw_proc_info_t frameInfo;
    158  1.8.8.2       tls     cursor.getInfo(&frameInfo);
    159  1.8.8.2       tls     if (frameInfo.end_ip == 0)
    160  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
    161  1.8.8.2       tls 
    162  1.8.8.2       tls     // Call stop function for each frame
    163  1.8.8.2       tls     action = (_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE);
    164  1.8.8.2       tls     _Unwind_Reason_Code result =
    165  1.8.8.2       tls         (*stop)(1, action, exc->exception_class, exc,
    166  1.8.8.2       tls                 (struct _Unwind_Context *)(&cursor), stop_arg);
    167  1.8.8.2       tls     if (result != _URC_NO_REASON)
    168  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
    169  1.8.8.2       tls 
    170  1.8.8.2       tls     if (frameInfo.handler == 0)
    171  1.8.8.2       tls       continue; // No personality routine, continue.
    172  1.8.8.2       tls 
    173  1.8.8.2       tls     __personality_routine p = (__personality_routine)(frameInfo.handler);
    174  1.8.8.2       tls     result = (*p)(1, action, exc->exception_class, exc,
    175  1.8.8.2       tls                   (struct _Unwind_Context *)(&cursor));
    176  1.8.8.2       tls 
    177  1.8.8.2       tls     switch (result) {
    178  1.8.8.2       tls     case _URC_CONTINUE_UNWIND:
    179  1.8.8.2       tls       // Destructors called, continue.
    180  1.8.8.2       tls       break;
    181  1.8.8.2       tls     case _URC_INSTALL_CONTEXT:
    182  1.8.8.2       tls       // Transfer control to landing pad.
    183  1.8.8.2       tls       cursor.jumpto();
    184  1.8.8.2       tls     default:
    185  1.8.8.2       tls       // Bad personality routine.
    186  1.8.8.2       tls       return _URC_FATAL_PHASE2_ERROR;
    187  1.8.8.2       tls     }
    188  1.8.8.2       tls   }
    189  1.8.8.2       tls }
    190  1.8.8.2       tls 
    191  1.8.8.2       tls _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *exc) {
    192  1.8.8.2       tls   NativeUnwindRegisters registers;
    193  1.8.8.2       tls   ThisUnwindCursor cursor1(registers, sThisAddressSpace);
    194  1.8.8.2       tls   ThisUnwindCursor cursor2(registers, sThisAddressSpace);
    195  1.8.8.2       tls 
    196  1.8.8.2       tls   // Mark this as a non-forced unwind for _Unwind_Resume().
    197  1.8.8.2       tls   exc->private_1 = 0;
    198  1.8.8.2       tls   exc->private_2 = 0;
    199  1.8.8.2       tls 
    200  1.8.8.2       tls   // Phase 1: searching.
    201  1.8.8.2       tls   _Unwind_Reason_Code phase1 = unwind_phase1(cursor1, exc);
    202  1.8.8.2       tls   if (phase1 != _URC_NO_REASON)
    203  1.8.8.2       tls     return phase1;
    204  1.8.8.2       tls 
    205  1.8.8.2       tls   // Phase 2: cleaning up.
    206  1.8.8.2       tls   return unwind_phase2(cursor2, exc);
    207  1.8.8.2       tls }
    208  1.8.8.2       tls 
    209  1.8.8.2       tls _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *exc,
    210  1.8.8.2       tls                                          _Unwind_Stop_Fn stop, void *stop_arg) {
    211  1.8.8.2       tls   NativeUnwindRegisters registers;
    212  1.8.8.2       tls   ThisUnwindCursor cursor(registers, sThisAddressSpace);
    213  1.8.8.2       tls 
    214  1.8.8.2       tls   // Mark this as forced unwind for _Unwind_Resume().
    215  1.8.8.2       tls   exc->private_1 = (uintptr_t)stop;
    216  1.8.8.2       tls   exc->private_2 = (uintptr_t)stop_arg;
    217  1.8.8.2       tls 
    218  1.8.8.2       tls   return unwind_phase2_forced(cursor, exc, stop, stop_arg);
    219  1.8.8.2       tls }
    220  1.8.8.2       tls 
    221  1.8.8.2       tls void _Unwind_Resume(struct _Unwind_Exception *exc) {
    222  1.8.8.2       tls   NativeUnwindRegisters registers;
    223  1.8.8.2       tls   ThisUnwindCursor cursor(registers, sThisAddressSpace);
    224  1.8.8.2       tls 
    225  1.8.8.2       tls   if (exc->private_1 != 0)
    226  1.8.8.2       tls     unwind_phase2_forced(cursor, exc, (_Unwind_Stop_Fn)exc->private_1,
    227  1.8.8.2       tls                          (void *)exc->private_2);
    228  1.8.8.2       tls   else
    229  1.8.8.2       tls     unwind_phase2(cursor, exc);
    230  1.8.8.2       tls   abort();
    231  1.8.8.2       tls }
    232  1.8.8.2       tls 
    233  1.8.8.2       tls _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *exc) {
    234  1.8.8.2       tls   // This is a re-throw, if this is a non-forced unwind
    235  1.8.8.2       tls   // and the stopping place was found.
    236  1.8.8.2       tls   // In that case, call _Unwind_RaiseException() as if
    237  1.8.8.2       tls   // it was a new exception.
    238  1.8.8.2       tls 
    239  1.8.8.2       tls   if (exc->private_1 != 0)
    240  1.8.8.2       tls     _Unwind_Resume(exc);
    241  1.8.8.2       tls 
    242  1.8.8.2       tls   // This can return if there is no catch clause.
    243  1.8.8.2       tls   // In that case, __cxa_rethrow is expected to call std::terminate().
    244  1.8.8.2       tls   return _Unwind_RaiseException(exc);
    245  1.8.8.2       tls }
    246  1.8.8.2       tls 
    247  1.8.8.2       tls void _Unwind_DeleteException(struct _Unwind_Exception *exc) {
    248  1.8.8.2       tls   if (exc->exception_cleanup != NULL)
    249  1.8.8.2       tls     (*exc->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, exc);
    250  1.8.8.2       tls }
    251  1.8.8.2       tls 
    252  1.8.8.2       tls uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) {
    253  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    254  1.8.8.2       tls   return cursor->getReg(index);
    255  1.8.8.2       tls }
    256  1.8.8.2       tls 
    257  1.8.8.2       tls void _Unwind_SetGR(struct _Unwind_Context *context, int index,
    258  1.8.8.2       tls                    uintptr_t new_value) {
    259  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    260  1.8.8.2       tls   cursor->setReg(index, new_value);
    261  1.8.8.2       tls }
    262  1.8.8.2       tls 
    263  1.8.8.2       tls uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
    264  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    265  1.8.8.2       tls   return cursor->getIP();
    266  1.8.8.2       tls }
    267  1.8.8.2       tls 
    268  1.8.8.2       tls uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, int *isSignalFrame) {
    269  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    270  1.8.8.2       tls   *isSignalFrame = cursor->isSignalFrame() ? 1 : 0;
    271  1.8.8.2       tls   return cursor->getIP();
    272  1.8.8.2       tls }
    273  1.8.8.2       tls 
    274  1.8.8.2       tls void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t new_value) {
    275  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    276  1.8.8.2       tls   cursor->setIP(new_value);
    277  1.8.8.2       tls   unw_proc_info_t info;
    278  1.8.8.2       tls   cursor->getInfo(&info);
    279  1.8.8.2       tls   cursor->setInfoBasedOnIPRegister(false);
    280  1.8.8.2       tls }
    281  1.8.8.2       tls 
    282  1.8.8.2       tls uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context) {
    283  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    284  1.8.8.2       tls   unw_proc_info_t frameInfo;
    285  1.8.8.2       tls   cursor->getInfo(&frameInfo);
    286  1.8.8.2       tls   return frameInfo.end_ip ? frameInfo.start_ip : 0;
    287  1.8.8.2       tls }
    288  1.8.8.2       tls 
    289  1.8.8.2       tls uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
    290  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    291  1.8.8.2       tls   unw_proc_info_t frameInfo;
    292  1.8.8.2       tls   cursor->getInfo(&frameInfo);
    293  1.8.8.2       tls   return frameInfo.end_ip ? frameInfo.lsda : 0;
    294  1.8.8.2       tls }
    295  1.8.8.2       tls 
    296  1.8.8.2       tls _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
    297  1.8.8.2       tls   NativeUnwindRegisters registers;
    298  1.8.8.2       tls   ThisUnwindCursor cursor(registers, sThisAddressSpace);
    299  1.8.8.2       tls   cursor.setInfoBasedOnIPRegister();
    300  1.8.8.2       tls 
    301  1.8.8.2       tls   // Walk each frame.
    302  1.8.8.2       tls   while (true) {
    303  1.8.8.2       tls 
    304  1.8.8.2       tls     // Ask libuwind to get next frame (skip over first frame which is
    305  1.8.8.2       tls     // _Unwind_Backtrace()).
    306  1.8.8.2       tls     if (cursor.step() != UNW_STEP_SUCCESS)
    307  1.8.8.2       tls       return _URC_END_OF_STACK;
    308  1.8.8.2       tls 
    309  1.8.8.2       tls     // Call trace function with this frame.
    310  1.8.8.2       tls     _Unwind_Reason_Code result =
    311  1.8.8.2       tls         (*callback)((struct _Unwind_Context *)(&cursor), ref);
    312  1.8.8.2       tls     if (result != _URC_NO_REASON)
    313  1.8.8.2       tls       return result;
    314  1.8.8.2       tls   }
    315  1.8.8.2       tls }
    316  1.8.8.2       tls 
    317  1.8.8.2       tls uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) {
    318  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    319  1.8.8.2       tls   return cursor->getSP();
    320  1.8.8.2       tls }
    321  1.8.8.2       tls 
    322  1.8.8.2       tls void *_Unwind_FindEnclosingFunction(void *pc) {
    323  1.8.8.2       tls   NativeUnwindRegisters registers;
    324  1.8.8.2       tls   ThisUnwindCursor cursor(registers, sThisAddressSpace);
    325  1.8.8.2       tls 
    326  1.8.8.2       tls   unw_proc_info_t info;
    327  1.8.8.2       tls   cursor.setIP((uintptr_t)pc);
    328  1.8.8.2       tls   cursor.setInfoBasedOnIPRegister();
    329  1.8.8.2       tls 
    330  1.8.8.2       tls   cursor.getInfo(&info);
    331  1.8.8.2       tls   return info.end_ip ? (void *)info.start_ip : NULL;
    332  1.8.8.2       tls }
    333  1.8.8.2       tls 
    334  1.8.8.3  jdolecek void *_Unwind_Find_FDE(void *pc, struct dwarf_eh_bases *bases) {
    335  1.8.8.3  jdolecek   NativeUnwindRegisters registers;
    336  1.8.8.3  jdolecek   ThisUnwindCursor cursor(registers, sThisAddressSpace);
    337  1.8.8.3  jdolecek 
    338  1.8.8.3  jdolecek   unw_proc_info_t info;
    339  1.8.8.3  jdolecek   cursor.setIP((uintptr_t)pc);
    340  1.8.8.3  jdolecek   cursor.setInfoBasedOnIPRegister();
    341  1.8.8.3  jdolecek 
    342  1.8.8.3  jdolecek   cursor.getInfo(&info);
    343  1.8.8.3  jdolecek   if (info.end_ip == 0)
    344  1.8.8.3  jdolecek     return NULL;
    345  1.8.8.3  jdolecek   bases->tbase = 0; /* Not supported */
    346  1.8.8.3  jdolecek   bases->dbase = (void *)info.data_base;
    347  1.8.8.3  jdolecek   bases->func = (void *)info.start_ip;
    348  1.8.8.3  jdolecek   return (void *)info.unwind_info;
    349  1.8.8.3  jdolecek }
    350  1.8.8.3  jdolecek 
    351  1.8.8.2       tls uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) {
    352  1.8.8.2       tls   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
    353  1.8.8.2       tls   unw_proc_info_t frameInfo;
    354  1.8.8.2       tls   cursor->getInfo(&frameInfo);
    355  1.8.8.2       tls   return frameInfo.data_base;
    356  1.8.8.2       tls }
    357  1.8.8.2       tls 
    358  1.8.8.2       tls uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) { return 0; }
    359  1.8.8.2       tls 
    360  1.8.8.2       tls void __register_frame(const void *fde) {
    361  1.8.8.2       tls   MyCFIParser::pint_t pcStart, pcEnd;
    362  1.8.8.2       tls 
    363  1.8.8.2       tls   MyCFIParser::findPCRange(sThisAddressSpace, (uintptr_t)fde, pcStart, pcEnd);
    364  1.8.8.2       tls   if (pcEnd == 0)
    365  1.8.8.2       tls     return; // Bad FDE.
    366  1.8.8.2       tls 
    367  1.8.8.2       tls   sThisAddressSpace.addFDE(pcStart, pcEnd, (uintptr_t)fde);
    368  1.8.8.2       tls }
    369  1.8.8.2       tls 
    370  1.8.8.2       tls void __register_frame_info(const void *ehframe, void *storage) {
    371  1.8.8.2       tls   sThisAddressSpace.setLazyReload();
    372  1.8.8.2       tls }
    373  1.8.8.2       tls 
    374  1.8.8.2       tls void __deregister_frame(const void *fde) {
    375  1.8.8.2       tls   MyCFIParser::pint_t pcStart, pcEnd;
    376  1.8.8.2       tls 
    377  1.8.8.2       tls   MyCFIParser::findPCRange(sThisAddressSpace, (uintptr_t)fde, pcStart, pcEnd);
    378  1.8.8.2       tls   if (pcEnd == 0)
    379  1.8.8.2       tls     return; // Bad FDE.
    380  1.8.8.2       tls 
    381  1.8.8.2       tls   sThisAddressSpace.removeFDE(pcStart, pcEnd, (uintptr_t)fde);
    382  1.8.8.2       tls }
    383  1.8.8.2       tls 
    384  1.8.8.2       tls void *__deregister_frame_info(const void *ehFrameStart) {
    385  1.8.8.2       tls   sThisAddressSpace.removeDSO((LocalAddressSpace::pint_t)ehFrameStart);
    386  1.8.8.2       tls   return NULL;
    387  1.8.8.2       tls }
    388