Changes in / [ffd0ac2:5a73f0f]


Ignore:
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rffd0ac2 r5a73f0f  
    174174
    175175def notify_server(int wait) {
    176         sh """curl --data "wait=${wait}" -X POST http://plg2:8082/jenkins/notify > /dev/null || true"""
     176        sh """curl --silent --data "wait=${wait}" -X POST http://plg2:8082/jenkins/notify > /dev/null || true"""
    177177        return
    178178}
     
    324324
    325325                //Then publish the results
    326                 sh 'curl -H \'Content-Type: application/json\' --data @bench.json http://plg2:8082/jenkins/publish > /dev/null || true'
     326                sh 'curl -H "Content-Type: application/json" --silent --data @bench.json http://plg2:8082/jenkins/publish > /dev/null || true'
    327327        }
    328328}
  • src/benchmark/Makefile.am

    rffd0ac2 r5a73f0f  
    5959        @echo -e '\t"githash": "'${githash}'",'
    6060        @echo -e '\t"arch": "'   ${arch}   '",'
    61         @echo -e '\t"compile": {'
    62         @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :'
    63         @echo -e '\t\t"dummy" : {}'
    64         @echo -e '\t},'
    6561        @echo -e '\t"ctxswitch": {'
    6662        @echo -en '\t\t"coroutine":'
  • src/benchmark/Makefile.in

    rffd0ac2 r5a73f0f  
    473473        @echo -e '\t"githash": "'${githash}'",'
    474474        @echo -e '\t"arch": "'   ${arch}   '",'
    475         @echo -e '\t"compile": {'
    476         @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :'
    477         @echo -e '\t\t"dummy" : {}'
    478         @echo -e '\t},'
    479475        @echo -e '\t"ctxswitch": {'
    480476        @echo -en '\t\t"coroutine":'
  • src/driver/cfa.cc

    rffd0ac2 r5a73f0f  
    277277                args[nargs] = "--undefined=__cfaabi_dbg_bits_write";
    278278                nargs += 1;
    279                 args[nargs] = "-Xlinker";
    280                 nargs += 1;
    281                 args[nargs] = "--undefined=__cfaabi_interpose_startup";
    282                 nargs += 1;
    283279
    284280        } // if
  • src/libcfa/bits/locks.h

    rffd0ac2 r5a73f0f  
    5858
    5959#ifdef __cforall
    60         extern "C" {
    61                 extern void disable_interrupts();
    62                 extern void enable_interrupts_noPoll();
    63         }
    64 
    6560        extern void yield( unsigned int );
    6661        extern thread_local struct thread_desc *    volatile this_thread;
    67         extern thread_local struct processor *      volatile this_processor;
    6862
    6963        static inline void ?{}( __spinlock_t & this ) {
     
    7468        static inline _Bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    7569                _Bool result = __lock_test_and_test_and_set( this.lock );
    76                 if( result ) {
    77                         disable_interrupts();
    78                         __cfaabi_dbg_debug_do(
     70                __cfaabi_dbg_debug_do(
     71                        if( result ) {
    7972                                this.prev_name = caller;
    8073                                this.prev_thrd = this_thread;
    81                         )
    82                 }
     74                        }
     75                )
    8376                return result;
    8477        }
     
    10699                        #endif
    107100                }
    108                 disable_interrupts();
    109101                __cfaabi_dbg_debug_do(
    110102                        this.prev_name = caller;
     
    113105        }
    114106
    115         // // Lock the spinlock, yield if already acquired
    116         // static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    117         //      for ( unsigned int i = 1;; i += 1 ) {
    118         //              if ( __lock_test_and_test_and_set( this.lock ) ) break;
    119         //              yield( i );
    120         //      }
    121         //      disable_interrupts();
    122         //      __cfaabi_dbg_debug_do(
    123         //              this.prev_name = caller;
    124         //              this.prev_thrd = this_thread;
    125         //      )
    126         // }
     107        // Lock the spinlock, spin if already acquired
     108        static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
     109                for ( unsigned int i = 1;; i += 1 ) {
     110                        if ( __lock_test_and_test_and_set( this.lock ) ) break;
     111                        yield( i );
     112                }
     113                __cfaabi_dbg_debug_do(
     114                        this.prev_name = caller;
     115                        this.prev_thrd = this_thread;
     116                )
     117        }
    127118
    128119        static inline void unlock( __spinlock_t & this ) {
    129                 enable_interrupts_noPoll();
    130120                __lock_release( this.lock );
    131121        }
  • src/libcfa/concurrency/invoke.h

    rffd0ac2 r5a73f0f  
    134134                // instrusive link field for threads
    135135                struct thread_desc * next;
    136 
    137                 __cfaabi_dbg_debug_do(
    138                         // instrusive link field for debugging
    139                         struct thread_desc * dbg_next;
    140                         struct thread_desc * dbg_prev;
    141                 )
    142136     };
    143137
  • src/libcfa/concurrency/kernel.c

    rffd0ac2 r5a73f0f  
    242242void finishRunning(processor * this) {
    243243        if( this->finish.action_code == Release ) {
    244                 verify( disable_preempt_count > 1 );
    245244                unlock( *this->finish.lock );
    246245        }
     
    249248        }
    250249        else if( this->finish.action_code == Release_Schedule ) {
    251                 verify( disable_preempt_count > 1 );
    252250                unlock( *this->finish.lock );
    253251                ScheduleThread( this->finish.thrd );
    254252        }
    255253        else if( this->finish.action_code == Release_Multi ) {
    256                 verify( disable_preempt_count > this->finish.lock_count );
    257254                for(int i = 0; i < this->finish.lock_count; i++) {
    258255                        unlock( *this->finish.locks[i] );
     
    260257        }
    261258        else if( this->finish.action_code == Release_Multi_Schedule ) {
    262                 verify( disable_preempt_count > this->finish.lock_count );
    263259                for(int i = 0; i < this->finish.lock_count; i++) {
    264260                        unlock( *this->finish.locks[i] );
     
    367363        this_processor->finish.lock = lock;
    368364
    369         verify( disable_preempt_count > 1 );
     365        verify( disable_preempt_count > 0 );
    370366        suspend();
    371367        verify( disable_preempt_count > 0 );
     
    395391        this_processor->finish.thrd = thrd;
    396392
    397         verify( disable_preempt_count > 1 );
     393        verify( disable_preempt_count > 0 );
    398394        suspend();
    399395        verify( disable_preempt_count > 0 );
     
    519515        __cfaabi_dbg_print_safe("Kernel : Shutdown complete\n");
    520516}
    521 
    522 //=============================================================================================
    523 // Unexpected Terminating logic
    524 //=============================================================================================
    525 
    526517
    527518static __spinlock_t kernel_abort_lock;
     
    620611}
    621612
    622 //-----------------------------------------------------------------------------
    623 // Debug
    624 __cfaabi_dbg_debug_do(
    625         struct {
    626                 thread_desc * tail;
    627         } __cfaabi_dbg_thread_list = { NULL };
    628 
    629         void __cfaabi_dbg_thread_register( thread_desc * thrd ) {
    630                 if( !__cfaabi_dbg_thread_list.tail ) {
    631                         __cfaabi_dbg_thread_list.tail = thrd;
    632                         return;
    633                 }
    634                 __cfaabi_dbg_thread_list.tail->dbg_next = thrd;
    635                 thrd->dbg_prev = __cfaabi_dbg_thread_list.tail;
    636                 __cfaabi_dbg_thread_list.tail = thrd;
    637         }
    638 
    639         void __cfaabi_dbg_thread_unregister( thread_desc * thrd ) {
    640                 thread_desc * prev = thrd->dbg_prev;
    641                 thread_desc * next = thrd->dbg_next;
    642 
    643                 if( next ) { next->dbg_prev = prev; }
    644                 else       {
    645                         assert( __cfaabi_dbg_thread_list.tail == thrd );
    646                         __cfaabi_dbg_thread_list.tail = prev;
    647                 }
    648 
    649                 if( prev ) { prev->dbg_next = next; }
    650 
    651                 thrd->dbg_prev = NULL;
    652                 thrd->dbg_next = NULL;
    653         }
    654 )
    655613// Local Variables: //
    656614// mode: c //
  • src/libcfa/concurrency/kernel_private.h

    rffd0ac2 r5a73f0f  
    8585extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
    8686
    87 __cfaabi_dbg_debug_do(
    88         extern void __cfaabi_dbg_thread_register  ( thread_desc * thrd );
    89         extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd );
    90 )
    91 
    9287//-----------------------------------------------------------------------------
    9388// Utils
  • src/libcfa/concurrency/monitor.c

    rffd0ac2 r5a73f0f  
    5353static inline __lock_size_t aggregate    ( monitor_desc * storage [], const __waitfor_mask_t & mask );
    5454
     55#ifndef __CFA_LOCK_NO_YIELD
     56#define DO_LOCK lock_yield
     57#else
     58#define DO_LOCK lock
     59#endif
     60
    5561//-----------------------------------------------------------------------------
    5662// Useful defines
     
    8490        static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) {
    8591                // Lock the monitor spinlock
    86                 lock( this->lock __cfaabi_dbg_ctx2 );
     92                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    8793                thread_desc * thrd = this_thread;
    88 
    89                 verify( disable_preempt_count > 0 );
    9094
    9195                __cfaabi_dbg_print_safe("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner);
     
    117121                        // Some one else has the monitor, wait in line for it
    118122                        append( this->entry_queue, thrd );
    119 
    120                         verify( disable_preempt_count > 0 );
    121 
    122123                        BlockInternal( &this->lock );
    123124
     
    137138        static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) {
    138139                // Lock the monitor spinlock
    139                 lock( this->lock __cfaabi_dbg_ctx2 );
     140                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    140141                thread_desc * thrd = this_thread;
    141142
     
    200201        // Leave single monitor
    201202        void __leave_monitor_desc( monitor_desc * this ) {
    202                 // Lock the monitor spinlock
    203                 lock( this->lock __cfaabi_dbg_ctx2 );
     203                // Lock the monitor spinlock, DO_LOCK to reduce contention
     204                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    204205
    205206                __cfaabi_dbg_print_safe("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner);
     
    247248
    248249                // Lock the monitor now
    249                 lock( this->lock __cfaabi_dbg_ctx2 );
     250                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    250251
    251252                disable_interrupts();
     
    396397        append( this.blocked, &waiter );
    397398
    398         verify( disable_preempt_count == 0 );
    399 
    400399        // Lock all monitors (aggregates the locks as well)
    401400        lock_all( monitors, locks, count );
    402 
    403         // verifyf( disable_preempt_count == count, "Got %d, expected %d\n", disable_preempt_count, count );
    404         if(disable_preempt_count != count) { __cfaabi_dbg_print_buffer_decl("----------Gonna crash\n"); }
    405401
    406402        // Find the next thread(s) to run
     
    477473        monitor_ctx( this.monitors, this.monitor_count );
    478474
    479         verify( disable_preempt_count == 0 );
    480 
    481475        // Lock all monitors (aggregates the locks them as well)
    482476        lock_all( monitors, locks, count );
    483 
    484         // verify( disable_preempt_count == count );
    485         if(disable_preempt_count != count) { __cfaabi_dbg_print_buffer_decl("----------Gonna crash\n"); }
    486 
    487477
    488478        // Create the node specific to this wait operation
     
    747737static inline void lock_all( __spinlock_t * locks [], __lock_size_t count ) {
    748738        for( __lock_size_t i = 0; i < count; i++ ) {
    749                 lock( *locks[i] __cfaabi_dbg_ctx2 );
     739                DO_LOCK( *locks[i] __cfaabi_dbg_ctx2 );
    750740        }
    751741}
     
    754744        for( __lock_size_t i = 0; i < count; i++ ) {
    755745                __spinlock_t * l = &source[i]->lock;
    756                 lock( *l __cfaabi_dbg_ctx2 );
     746                DO_LOCK( *l __cfaabi_dbg_ctx2 );
    757747                if(locks) locks[i] = l;
    758748        }
  • src/libcfa/concurrency/preemption.c

    rffd0ac2 r5a73f0f  
    1919extern "C" {
    2020#include <errno.h>
     21#include <execinfo.h>
     22#define __USE_GNU
     23#include <signal.h>
     24#undef __USE_GNU
    2125#include <stdio.h>
    2226#include <string.h>
     
    2529#undef ftype
    2630
    27 #include "bits/signal.h"
     31#ifdef __USE_STREAM__
     32#include "fstream"
     33#endif
    2834
    2935//TODO move to defaults
     
    3440        return __CFA_DEFAULT_PREEMPTION__;
    3541}
     42
     43// Short hands for signal context information
     44#define __CFA_SIGCXT__ ucontext_t *
     45#define __CFA_SIGPARMS__ __attribute__((unused)) int sig, __attribute__((unused)) siginfo_t *sfp, __attribute__((unused)) __CFA_SIGCXT__ cxt
    3646
    3747// FwdDeclarations : timeout handlers
     
    4353void sigHandler_segv     ( __CFA_SIGPARMS__ );
    4454void sigHandler_abort    ( __CFA_SIGPARMS__ );
     55
     56// FwdDeclarations : sigaction wrapper
     57static void __kernel_sigaction( int sig, void (*handler)(__CFA_SIGPARMS__), int flags );
    4558
    4659// FwdDeclarations : alarm thread main
     
    169182        void enable_interrupts_noPoll() {
    170183                __attribute__((unused)) unsigned short prev = __atomic_fetch_add_2( &disable_preempt_count, -1, __ATOMIC_SEQ_CST );
    171                 verifyf( prev != 0u, "Incremented from %u\n", prev );                     // If this triggers someone is enabled already enabled interrupts
     184                verify( prev != 0u );                     // If this triggers someone is enabled already enabled interrupts
    172185        }
    173186}
     
    233246        // Setup proper signal handlers
    234247        __kernel_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART );         // CtxSwitch handler
     248        // __kernel_sigaction( SIGSEGV, sigHandler_segv     , SA_SIGINFO );      // Failure handler
     249        // __kernel_sigaction( SIGBUS , sigHandler_segv     , SA_SIGINFO );      // Failure handler
    235250
    236251        signal_block( SIGALRM );
     
    293308        if( !preemption_ready() ) { return; }
    294309
    295         __cfaabi_dbg_print_buffer_decl(" KERNEL: preempting core %p (%p).\n", this_processor, this_thread);
     310        // __cfaabi_dbg_print_buffer_decl(" KERNEL: preempting core %p (%p).\n", this_processor, this_thread);
    296311
    297312        preemption_in_progress = true;                      // Sync flag : prevent recursive calls to the signal handler
     
    365380}
    366381
     382// Sigaction wrapper : register an signal handler
     383static void __kernel_sigaction( int sig, void (*handler)(__CFA_SIGPARMS__), int flags ) {
     384        struct sigaction act;
     385
     386        act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
     387        act.sa_flags = flags;
     388
     389        if ( sigaction( sig, &act, NULL ) == -1 ) {
     390                __cfaabi_dbg_print_buffer_decl(
     391                        " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
     392                        sig, handler, flags, errno, strerror( errno )
     393                );
     394                _exit( EXIT_FAILURE );
     395        }
     396}
     397
     398// Sigaction wrapper : restore default handler
     399static void __kernel_sigdefault( int sig ) {
     400        struct sigaction act;
     401
     402        act.sa_handler = SIG_DFL;
     403        act.sa_flags = 0;
     404        sigemptyset( &act.sa_mask );
     405
     406        if ( sigaction( sig, &act, NULL ) == -1 ) {
     407                __cfaabi_dbg_print_buffer_decl(
     408                        " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",
     409                        sig, errno, strerror( errno )
     410                );
     411                _exit( EXIT_FAILURE );
     412        }
     413}
     414
     415//=============================================================================================
     416// Terminating Signals logic
     417//=============================================================================================
     418
     419__cfaabi_dbg_debug_do(
     420        static void __kernel_backtrace( int start ) {
     421                // skip first N stack frames
     422
     423                enum { Frames = 50 };
     424                void * array[Frames];
     425                int size = backtrace( array, Frames );
     426                char ** messages = backtrace_symbols( array, size );
     427
     428                // find executable name
     429                *index( messages[0], '(' ) = '\0';
     430                #ifdef __USE_STREAM__
     431                serr | "Stack back trace for:" | messages[0] | endl;
     432                #else
     433                fprintf( stderr, "Stack back trace for: %s\n", messages[0]);
     434                #endif
     435
     436                // skip last 2 stack frames after main
     437                for ( int i = start; i < size && messages != NULL; i += 1 ) {
     438                        char * name = NULL;
     439                        char * offset_begin = NULL;
     440                        char * offset_end = NULL;
     441
     442                        for ( char *p = messages[i]; *p; ++p ) {
     443                                // find parantheses and +offset
     444                                if ( *p == '(' ) {
     445                                        name = p;
     446                                }
     447                                else if ( *p == '+' ) {
     448                                        offset_begin = p;
     449                                }
     450                                else if ( *p == ')' ) {
     451                                        offset_end = p;
     452                                        break;
     453                                }
     454                        }
     455
     456                        // if line contains symbol print it
     457                        int frameNo = i - start;
     458                        if ( name && offset_begin && offset_end && name < offset_begin ) {
     459                                // delimit strings
     460                                *name++ = '\0';
     461                                *offset_begin++ = '\0';
     462                                *offset_end++ = '\0';
     463
     464                                #ifdef __USE_STREAM__
     465                                serr    | "("  | frameNo | ")" | messages[i] | ":"
     466                                        | name | "+" | offset_begin | offset_end | endl;
     467                                #else
     468                                fprintf( stderr, "(%i) %s : %s + %s %s\n", frameNo, messages[i], name, offset_begin, offset_end);
     469                                #endif
     470                        }
     471                        // otherwise, print the whole line
     472                        else {
     473                                #ifdef __USE_STREAM__
     474                                serr | "(" | frameNo | ")" | messages[i] | endl;
     475                                #else
     476                                fprintf( stderr, "(%i) %s\n", frameNo, messages[i] );
     477                                #endif
     478                        }
     479                }
     480
     481                free( messages );
     482        }
     483)
     484
     485// void sigHandler_segv( __CFA_SIGPARMS__ ) {
     486//      __cfaabi_dbg_debug_do(
     487//              #ifdef __USE_STREAM__
     488//              serr    | "*CFA runtime error* program cfa-cpp terminated with"
     489//                      | (sig == SIGSEGV ? "segment fault." : "bus error.")
     490//                      | endl;
     491//              #else
     492//              fprintf( stderr, "*CFA runtime error* program cfa-cpp terminated with %s\n", sig == SIGSEGV ? "segment fault." : "bus error." );
     493//              #endif
     494
     495//              // skip first 2 stack frames
     496//              __kernel_backtrace( 1 );
     497//      )
     498//      exit( EXIT_FAILURE );
     499// }
     500
     501// void sigHandler_abort( __CFA_SIGPARMS__ ) {
     502//      // skip first 6 stack frames
     503//      __cfaabi_dbg_debug_do( __kernel_backtrace( 6 ); )
     504
     505//      // reset default signal handler
     506//      __kernel_sigdefault( SIGABRT );
     507
     508//      raise( SIGABRT );
     509// }
     510
    367511// Local Variables: //
    368512// mode: c //
  • src/libcfa/concurrency/thread.c

    rffd0ac2 r5a73f0f  
    3333void ?{}(thread_desc& this) {
    3434        (this.self_cor){};
    35         this.self_cor.name = "Anonymous Thread";
     35        this.self_cor.name = "Anonymous Coroutine";
    3636        this.self_mon.owner = &this;
    3737        this.self_mon.recursion = 1;
    3838        this.self_mon_p = &this.self_mon;
    3939        this.next = NULL;
    40         __cfaabi_dbg_debug_do(
    41                 this.dbg_next = NULL;
    42                 this.dbg_prev = NULL;
    43                 __cfaabi_dbg_thread_register(&this);
    44         )
    4540
    4641        (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 };
     
    4843
    4944void ^?{}(thread_desc& this) {
    50         __cfaabi_dbg_debug_do(
    51                 __cfaabi_dbg_thread_unregister(&this);
    52         )
    5345        ^(this.self_cor){};
    5446}
  • src/libcfa/interpose.c

    rffd0ac2 r5a73f0f  
    2222#include <dlfcn.h>
    2323#include <unistd.h>
    24 #define __USE_GNU
    25 #include <signal.h>
    26 #undef __USE_GNU
    27 #include <execinfo.h>
    2824}
    2925
    3026#include "bits/debug.h"
    3127#include "bits/defs.h"
    32 #include "bits/signal.h"
    3328#include "startup.h"
    3429
    35 void __cfaabi_interpose_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
     30void interpose_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
    3631
    3732typedef void (*generic_fptr_t)(void);
     
    8984#define INIT_REALRTN( x, ver ) assign_ptr( (void**)&libc_##x, #x, ver)
    9085
    91 void sigHandler_segv ( __CFA_SIGPARMS__ );
    92 void sigHandler_abort( __CFA_SIGPARMS__ );
    93 
    94 void __cfaabi_interpose_startup() {
     86void interpose_startup() {
    9587        const char *version = NULL;
    9688
    9789        INIT_REALRTN( abort, version );
    9890        INIT_REALRTN( exit, version );
    99 
    100         __kernel_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO );      // Failure handler
    101         __kernel_sigaction( SIGBUS , sigHandler_segv , SA_SIGINFO );      // Failure handler
    102         __kernel_sigaction( SIGABRT, sigHandler_abort, SA_SIGINFO );      // Failure handler
    10391}
    104 
    105 //=============================================================================================
    106 // Terminating Signals logic
    107 //=============================================================================================
    10892
    10993extern "C" {
     
    155139}
    156140
    157 // skip first 6 stack frames by default
    158 static void __kernel_backtrace() {
    159         // skip first N stack frames
    160         int start = 6;
    161 
    162         enum { Frames = 50 };
    163         void * array[Frames];
    164         int size = backtrace( array, Frames );
    165         char ** messages = backtrace_symbols( array, size );
    166 
    167         // find executable name
    168         *index( messages[0], '(' ) = '\0';
    169         __cfaabi_dbg_bits_print_nolock( "Stack back trace for: %s\n", messages[0]);
    170 
    171         // skip last 2 stack frames after main
    172         for ( int i = start; i < size && messages != NULL; i += 1 ) {
    173                 char * name = NULL;
    174                 char * offset_begin = NULL;
    175                 char * offset_end = NULL;
    176 
    177                 for ( char *p = messages[i]; *p; ++p ) {
    178                         // find parantheses and +offset
    179                         if ( *p == '(' ) {
    180                                 name = p;
    181                         }
    182                         else if ( *p == '+' ) {
    183                                 offset_begin = p;
    184                         }
    185                         else if ( *p == ')' ) {
    186                                 offset_end = p;
    187                                 break;
    188                         }
    189                 }
    190 
    191                 // if line contains symbol print it
    192                 int frameNo = i - start;
    193                 if ( name && offset_begin && offset_end && name < offset_begin ) {
    194                         // delimit strings
    195                         *name++ = '\0';
    196                         *offset_begin++ = '\0';
    197                         *offset_end++ = '\0';
    198 
    199                         __cfaabi_dbg_bits_print_nolock( "(%i) %s : %s + %s %s\n", frameNo, messages[i], name, offset_begin, offset_end);
    200                 }
    201                 // otherwise, print the whole line
    202                 else {
    203                         __cfaabi_dbg_bits_print_nolock( "(%i) %s\n", frameNo, messages[i] );
    204                 }
    205         }
    206 
    207         free( messages );
    208 }
    209 
    210 void sigHandler_segv( __CFA_SIGPARMS__ ) {
    211         // skip first only 1 stack frames in case of segfault.
    212         abortf( "*CFA runtime error* program cfa-cpp terminated with %s\n", sig == SIGSEGV ? "segment fault." : "bus error." );
    213 }
    214 
    215 void sigHandler_abort( __CFA_SIGPARMS__ ) {
    216         __kernel_backtrace();
    217 
    218         // reset default signal handler
    219         __kernel_sigdefault( SIGABRT );
    220 
    221         raise( SIGABRT );
    222 }
    223 
    224141// Local Variables: //
    225142// mode: c //
Note: See TracChangeset for help on using the changeset viewer.