Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r142930b rc40157e  
    5555}
    5656
     57struct __cfaehm_base_exception_t * __cfaehm_get_current_exception(void) {
     58        return this_exception_context()->current_exception;
     59}
    5760
    5861// RESUMPTION ================================================================
     
    309312                struct _Unwind_Context * unwind_context)
    310313{
    311         //! __cfadbg_print_safe(exception, "CFA: 0x%lx\n", _Unwind_GetCFA(unwind_context));
     314        //__cfadbg_print_safe(exception, "CFA: 0x%lx\n", _Unwind_GetCFA(context));
    312315        __cfadbg_print_safe(exception, "Personality function (%d, %x, %llu, %p, %p):",
    313316                        version, actions, exception_class, unwind_exception, unwind_context);
     
    479482// and simply linked from libcfa but there is one problem left, see the exception table for details
    480483__attribute__((noinline))
    481 void __cfaehm_try_terminate(void (*try_block)(),
    482                 void (*catch_block)(int index, exception_t * except),
     484int __cfaehm_try_terminate(void (*try_block)(),
     485                __attribute__((unused)) void (*catch_block)(int index, exception_t * except),
    483486                __attribute__((unused)) int (*match_block)(exception_t * except)) {
    484487        //! volatile int xy = 0;
    485         //! printf("%p %p %p %p\n", &try_block, &catch_block, &match_block, &xy);
     488        //! printf("%p %p %p\n", &try_block, &match_block, &xy);
    486489
    487490        // Setup the personality routine and exception table.
     
    507510
    508511        // Normal return for when there is no throw.
    509         return;
     512        return 0;
    510513
    511514        // Exceptionnal path
     
    518521        asm volatile (".CATCH:");
    519522
    520         // Exception handler
    521         // Note: Saving the exception context on the stack breaks termination exceptions.
    522         catch_block( EXCEPT_TO_NODE( this_exception_context()->current_exception )->handler_index,
    523                      this_exception_context()->current_exception );
     523        return EXCEPT_TO_NODE( this_exception_context()->current_exception )->handler_index;
    524524}
    525525
Note: See TracChangeset for help on using the changeset viewer.