Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r8108ba8 r13600e8  
    99// Author           : Andrew Beach
    1010// Created On       : Mon Jun 26 15:13:00 2017
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Feb 24 13:40:00 2021
    13 // Update Count     : 36
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 10 16:45:22 2023
     13// Update Count     : 69
    1414//
    1515
     
    2727#include "stdhdr/assert.h"
    2828#include "virtual.h"
     29
     30extern void __cabi_abort( const char fmt[], ... );
    2931
    3032#pragma GCC visibility push(default)
     
    123125
    124126// Creates a copy of the indicated exception and sets current_exception to it.
    125 static void __cfaehm_allocate_exception( exception_t * except ) {
     127void __cfaehm_allocate_exception( exception_t * except ) {
    126128        struct exception_context_t * context = this_exception_context();
    127129
     
    192194
    193195        if ( actions & _UA_END_OF_STACK ) {
    194                 abort();
     196                __cabi_abort(
     197                        "Propagation failed to find a matching handler.\n"
     198                        "Possible cause is a missing try block with appropriate catch clause for specified exception type.\n"
     199                        "Last exception name or message: %s.\n",
     200                        NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) )->
     201                                virtual_table->msg( NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) ) )
     202                );
    195203        } else {
    196204                return _URC_NO_REASON;
     
    209217        struct exception_context_t * context = this_exception_context();
    210218        struct __cfaehm_node * node = EXCEPT_TO_NODE(context->current_exception);
    211 
    212         // Preform clean-up of any extra active exceptions.
    213         while ( node->next ) {
    214                 struct __cfaehm_node * to_free = node->next;
    215                 node->next = to_free->next;
    216                 exception_t * except = NODE_TO_EXCEPT( to_free );
    217                 except->virtual_table->free( except );
    218             free( to_free );
    219         }
    220219
    221220        _Unwind_Reason_Code ret;
     
    239238
    240239// The exception that is being thrown must already be stored.
    241 static void __cfaehm_begin_unwind(void(*defaultHandler)(exception_t *)) {
     240void __cfaehm_begin_unwind(void(*defaultHandler)(exception_t *)) {
    242241        struct exception_context_t * context = this_exception_context();
    243242        if ( NULL == context->current_exception ) {
     
    568567        "       .hidden CFA.ref.__gcfa_personality_v0\n"
    569568        "       .weak   CFA.ref.__gcfa_personality_v0\n"
    570         // No clue what this does specifically
    571         "       .section        .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n"
    572569#if defined( __x86_64 ) || defined( __i386 )
    573570        "       .align 8\n"
Note: See TracChangeset for help on using the changeset viewer.