Changes in / [389528b0:35bae526]


Ignore:
Location:
src
Files:
2 added
2 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptTranslate.cc

    r389528b0 r35bae526  
    211211                        ThrowStmt *throwStmt ) {
    212212                // __throw_terminate( `throwStmt->get_name()` ); }
    213                 return create_given_throw( "__cfaehm__throw_terminate", throwStmt );
     213                return create_given_throw( "__cfaabi_ehm__throw_terminate", throwStmt );
    214214        }
    215215
     
    232232                result->push_back( new ExprStmt(
    233233                        noLabels,
    234                         new UntypedExpr( new NameExpr( "__cfaehm__rethrow_terminate" ) )
     234                        new UntypedExpr( new NameExpr( "__cfaabi_ehm__rethrow_terminate" ) )
    235235                        ) );
    236236                delete throwStmt;
     
    241241                        ThrowStmt *throwStmt ) {
    242242                // __throw_resume( `throwStmt->get_name` );
    243                 return create_given_throw( "__cfaehm__throw_resume", throwStmt );
     243                return create_given_throw( "__cfaabi_ehm__throw_resume", throwStmt );
    244244        }
    245245
     
    309309                        local_except->get_attributes().push_back( new Attribute(
    310310                                "cleanup",
    311                                 { new NameExpr( "__cfaehm__cleanup_terminate" ) }
     311                                { new NameExpr( "__cfaabi_ehm__cleanup_terminate" ) }
    312312                                ) );
    313313
     
    432432                        FunctionDecl * terminate_catch,
    433433                        FunctionDecl * terminate_match ) {
    434                 // { __cfaehm__try_terminate(`try`, `catch`, `match`); }
     434                // { __cfaabi_ehm__try_terminate(`try`, `catch`, `match`); }
    435435
    436436                UntypedExpr * caller = new UntypedExpr( new NameExpr(
    437                         "__cfaehm__try_terminate" ) );
     437                        "__cfaabi_ehm__try_terminate" ) );
    438438                std::list<Expression *>& args = caller->get_args();
    439439                args.push_back( nameOf( try_wrapper ) );
     
    489489
    490490                // struct __try_resume_node __resume_node
    491                 //      __attribute__((cleanup( __cfaehm__try_resume_cleanup )));
     491                //      __attribute__((cleanup( __cfaabi_ehm__try_resume_cleanup )));
    492492                // ** unwinding of the stack here could cause problems **
    493493                // ** however I don't think that can happen currently **
    494                 // __cfaehm__try_resume_setup( &__resume_node, resume_handler );
     494                // __cfaabi_ehm__try_resume_setup( &__resume_node, resume_handler );
    495495
    496496                std::list< Attribute * > attributes;
     
    498498                        std::list< Expression * > attr_params;
    499499                        attr_params.push_back( new NameExpr(
    500                                 "__cfaehm__try_resume_cleanup" ) );
     500                                "__cfaabi_ehm__try_resume_cleanup" ) );
    501501                        attributes.push_back( new Attribute( "cleanup", attr_params ) );
    502502                }
     
    517517
    518518                UntypedExpr *setup = new UntypedExpr( new NameExpr(
    519                         "__cfaehm__try_resume_setup" ) );
     519                        "__cfaabi_ehm__try_resume_setup" ) );
    520520                setup->get_args().push_back( new AddressExpr( nameOf( obj ) ) );
    521521                setup->get_args().push_back( nameOf( resume_handler ) );
     
    542542        ObjectDecl * ExceptionMutatorCore::create_finally_hook(
    543543                        FunctionDecl * finally_wrapper ) {
    544                 // struct __cfaehm__cleanup_hook __finally_hook
     544                // struct __cfaabi_ehm__cleanup_hook __finally_hook
    545545                //      __attribute__((cleanup( finally_wrapper )));
    546546
     
    596596                        // Skip children?
    597597                        return;
    598                 } else if ( structDecl->get_name() == "__cfaehm__base_exception_t" ) {
     598                } else if ( structDecl->get_name() == "__cfaabi_ehm__base_exception_t" ) {
    599599                        assert( nullptr == except_decl );
    600600                        except_decl = structDecl;
    601601                        init_func_types();
    602                 } else if ( structDecl->get_name() == "__cfaehm__try_resume_node" ) {
     602                } else if ( structDecl->get_name() == "__cfaabi_ehm__try_resume_node" ) {
    603603                        assert( nullptr == node_decl );
    604604                        node_decl = structDecl;
    605                 } else if ( structDecl->get_name() == "__cfaehm__cleanup_hook" ) {
     605                } else if ( structDecl->get_name() == "__cfaabi_ehm__cleanup_hook" ) {
    606606                        assert( nullptr == hook_decl );
    607607                        hook_decl = structDecl;
  • src/ResolvExpr/Resolver.cc

    r389528b0 r35bae526  
    369369                if ( throwStmt->get_expr() ) {
    370370                        StructDecl * exception_decl =
    371                                 indexer.lookupStruct( "__cfaehm__base_exception_t" );
     371                                indexer.lookupStruct( "__cfaabi_ehm__base_exception_t" );
    372372                        assert( exception_decl );
    373373                        Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) );
  • src/driver/cfa.cc

    r389528b0 r35bae526  
    275275                args[nargs] = "-Xlinker";
    276276                nargs += 1;
    277                 args[nargs] = "--undefined=__lib_debug_write";
     277                args[nargs] = "--undefined=__cfaabi_dbg_bits_write";
    278278                nargs += 1;
    279279
  • src/libcfa/Makefile.am

    r389528b0 r35bae526  
    5555
    5656libobjs = ${headers:=.o}
    57 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
     57libsrc = libcfa-prelude.c interpose.c bits/debug.c ${headers:=.c} \
    5858         assert.c exception.c virtual.c
    5959
     
    102102        bits/containers.h               \
    103103        bits/defs.h             \
     104        bits/debug.h            \
    104105        bits/locks.h            \
    105106        concurrency/invoke.h    \
    106107        libhdr.h                        \
    107108        libhdr/libalign.h       \
    108         libhdr/libdebug.h       \
    109109        libhdr/libtools.h
    110110
  • src/libcfa/Makefile.in

    r389528b0 r35bae526  
    149149libcfa_d_a_LIBADD =
    150150am__libcfa_d_a_SOURCES_DIST = libcfa-prelude.c interpose.c \
    151         libhdr/libdebug.c fstream.c iostream.c iterator.c limits.c \
     151        bits/debug.c fstream.c iostream.c iterator.c limits.c \
    152152        rational.c stdlib.c containers/maybe.c containers/pair.c \
    153153        containers/result.c containers/vector.c \
     
    175175@BUILD_CONCURRENCY_TRUE@        concurrency/libcfa_d_a-preemption.$(OBJEXT)
    176176am__objects_4 = libcfa_d_a-libcfa-prelude.$(OBJEXT) \
    177         libcfa_d_a-interpose.$(OBJEXT) \
    178         libhdr/libcfa_d_a-libdebug.$(OBJEXT) $(am__objects_2) \
    179         libcfa_d_a-assert.$(OBJEXT) libcfa_d_a-exception.$(OBJEXT) \
    180         libcfa_d_a-virtual.$(OBJEXT) $(am__objects_3)
     177        libcfa_d_a-interpose.$(OBJEXT) bits/libcfa_d_a-debug.$(OBJEXT) \
     178        $(am__objects_2) libcfa_d_a-assert.$(OBJEXT) \
     179        libcfa_d_a-exception.$(OBJEXT) libcfa_d_a-virtual.$(OBJEXT) \
     180        $(am__objects_3)
    181181am_libcfa_d_a_OBJECTS = $(am__objects_4)
    182182libcfa_d_a_OBJECTS = $(am_libcfa_d_a_OBJECTS)
    183183libcfa_a_AR = $(AR) $(ARFLAGS)
    184184libcfa_a_LIBADD =
    185 am__libcfa_a_SOURCES_DIST = libcfa-prelude.c interpose.c \
    186         libhdr/libdebug.c fstream.c iostream.c iterator.c limits.c \
    187         rational.c stdlib.c containers/maybe.c containers/pair.c \
    188         containers/result.c containers/vector.c \
    189         concurrency/coroutine.c concurrency/thread.c \
    190         concurrency/kernel.c concurrency/monitor.c assert.c \
    191         exception.c virtual.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
    192         concurrency/alarm.c concurrency/invoke.c \
    193         concurrency/preemption.c
     185am__libcfa_a_SOURCES_DIST = libcfa-prelude.c interpose.c bits/debug.c \
     186        fstream.c iostream.c iterator.c limits.c rational.c stdlib.c \
     187        containers/maybe.c containers/pair.c containers/result.c \
     188        containers/vector.c concurrency/coroutine.c \
     189        concurrency/thread.c concurrency/kernel.c \
     190        concurrency/monitor.c assert.c exception.c virtual.c \
     191        concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
     192        concurrency/invoke.c concurrency/preemption.c
    194193@BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \
    195194@BUILD_CONCURRENCY_TRUE@        concurrency/libcfa_a-thread.$(OBJEXT) \
     
    208207@BUILD_CONCURRENCY_TRUE@        concurrency/libcfa_a-preemption.$(OBJEXT)
    209208am__objects_8 = libcfa_a-libcfa-prelude.$(OBJEXT) \
    210         libcfa_a-interpose.$(OBJEXT) \
    211         libhdr/libcfa_a-libdebug.$(OBJEXT) $(am__objects_6) \
    212         libcfa_a-assert.$(OBJEXT) libcfa_a-exception.$(OBJEXT) \
    213         libcfa_a-virtual.$(OBJEXT) $(am__objects_7)
     209        libcfa_a-interpose.$(OBJEXT) bits/libcfa_a-debug.$(OBJEXT) \
     210        $(am__objects_6) libcfa_a-assert.$(OBJEXT) \
     211        libcfa_a-exception.$(OBJEXT) libcfa_a-virtual.$(OBJEXT) \
     212        $(am__objects_7)
    214213am_libcfa_a_OBJECTS = $(am__objects_8)
    215214libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
     
    265264        concurrency/thread concurrency/kernel concurrency/monitor \
    266265        ${shell echo stdhdr/*} math gmp bits/containers.h bits/defs.h \
    267         bits/locks.h concurrency/invoke.h libhdr.h libhdr/libalign.h \
    268         libhdr/libdebug.h libhdr/libtools.h
     266        bits/debug.h bits/locks.h concurrency/invoke.h libhdr.h \
     267        libhdr/libalign.h libhdr/libtools.h
    269268HEADERS = $(nobase_cfa_include_HEADERS)
    270269am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
     
    424423        containers/vector $(am__append_3)
    425424libobjs = ${headers:=.o}
    426 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
     425libsrc = libcfa-prelude.c interpose.c bits/debug.c ${headers:=.c} \
    427426        assert.c exception.c virtual.c $(am__append_4)
    428427libcfa_a_SOURCES = ${libsrc}
     
    439438        bits/containers.h               \
    440439        bits/defs.h             \
     440        bits/debug.h            \
    441441        bits/locks.h            \
    442442        concurrency/invoke.h    \
    443443        libhdr.h                        \
    444444        libhdr/libalign.h       \
    445         libhdr/libdebug.h       \
    446445        libhdr/libtools.h
    447446
     
    511510clean-libLIBRARIES:
    512511        -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
    513 libhdr/$(am__dirstamp):
    514         @$(MKDIR_P) libhdr
    515         @: > libhdr/$(am__dirstamp)
    516 libhdr/$(DEPDIR)/$(am__dirstamp):
    517         @$(MKDIR_P) libhdr/$(DEPDIR)
    518         @: > libhdr/$(DEPDIR)/$(am__dirstamp)
    519 libhdr/libcfa_d_a-libdebug.$(OBJEXT): libhdr/$(am__dirstamp) \
    520         libhdr/$(DEPDIR)/$(am__dirstamp)
     512bits/$(am__dirstamp):
     513        @$(MKDIR_P) bits
     514        @: > bits/$(am__dirstamp)
     515bits/$(DEPDIR)/$(am__dirstamp):
     516        @$(MKDIR_P) bits/$(DEPDIR)
     517        @: > bits/$(DEPDIR)/$(am__dirstamp)
     518bits/libcfa_d_a-debug.$(OBJEXT): bits/$(am__dirstamp) \
     519        bits/$(DEPDIR)/$(am__dirstamp)
    521520containers/$(am__dirstamp):
    522521        @$(MKDIR_P) containers
     
    563562        $(AM_V_AR)$(libcfa_d_a_AR) libcfa-d.a $(libcfa_d_a_OBJECTS) $(libcfa_d_a_LIBADD)
    564563        $(AM_V_at)$(RANLIB) libcfa-d.a
    565 libhdr/libcfa_a-libdebug.$(OBJEXT): libhdr/$(am__dirstamp) \
    566         libhdr/$(DEPDIR)/$(am__dirstamp)
     564bits/libcfa_a-debug.$(OBJEXT): bits/$(am__dirstamp) \
     565        bits/$(DEPDIR)/$(am__dirstamp)
    567566containers/libcfa_a-maybe.$(OBJEXT): containers/$(am__dirstamp) \
    568567        containers/$(DEPDIR)/$(am__dirstamp)
     
    596595mostlyclean-compile:
    597596        -rm -f *.$(OBJEXT)
     597        -rm -f bits/*.$(OBJEXT)
    598598        -rm -f concurrency/*.$(OBJEXT)
    599599        -rm -f containers/*.$(OBJEXT)
    600         -rm -f libhdr/*.$(OBJEXT)
    601600
    602601distclean-compile:
     
    625624@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@
    626625@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-virtual.Po@am__quote@
     626@AMDEP_TRUE@@am__include@ @am__quote@bits/$(DEPDIR)/libcfa_a-debug.Po@am__quote@
     627@AMDEP_TRUE@@am__include@ @am__quote@bits/$(DEPDIR)/libcfa_d_a-debug.Po@am__quote@
    627628@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@
    628629@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-alarm.Po@am__quote@
     
    648649@AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-result.Po@am__quote@
    649650@AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-vector.Po@am__quote@
    650 @AMDEP_TRUE@@am__include@ @am__quote@libhdr/$(DEPDIR)/libcfa_a-libdebug.Po@am__quote@
    651 @AMDEP_TRUE@@am__include@ @am__quote@libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Po@am__quote@
    652651
    653652.S.o:
     
    704703@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-interpose.obj `if test -f 'interpose.c'; then $(CYGPATH_W) 'interpose.c'; else $(CYGPATH_W) '$(srcdir)/interpose.c'; fi`
    705704
    706 libhdr/libcfa_d_a-libdebug.o: libhdr/libdebug.c
    707 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libhdr/libcfa_d_a-libdebug.o -MD -MP -MF libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Tpo -c -o libhdr/libcfa_d_a-libdebug.o `test -f 'libhdr/libdebug.c' || echo '$(srcdir)/'`libhdr/libdebug.c
    708 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Tpo libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Po
    709 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='libhdr/libdebug.c' object='libhdr/libcfa_d_a-libdebug.o' libtool=no @AMDEPBACKSLASH@
    710 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    711 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libhdr/libcfa_d_a-libdebug.o `test -f 'libhdr/libdebug.c' || echo '$(srcdir)/'`libhdr/libdebug.c
    712 
    713 libhdr/libcfa_d_a-libdebug.obj: libhdr/libdebug.c
    714 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libhdr/libcfa_d_a-libdebug.obj -MD -MP -MF libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Tpo -c -o libhdr/libcfa_d_a-libdebug.obj `if test -f 'libhdr/libdebug.c'; then $(CYGPATH_W) 'libhdr/libdebug.c'; else $(CYGPATH_W) '$(srcdir)/libhdr/libdebug.c'; fi`
    715 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Tpo libhdr/$(DEPDIR)/libcfa_d_a-libdebug.Po
    716 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='libhdr/libdebug.c' object='libhdr/libcfa_d_a-libdebug.obj' libtool=no @AMDEPBACKSLASH@
    717 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    718 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libhdr/libcfa_d_a-libdebug.obj `if test -f 'libhdr/libdebug.c'; then $(CYGPATH_W) 'libhdr/libdebug.c'; else $(CYGPATH_W) '$(srcdir)/libhdr/libdebug.c'; fi`
     705bits/libcfa_d_a-debug.o: bits/debug.c
     706@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT bits/libcfa_d_a-debug.o -MD -MP -MF bits/$(DEPDIR)/libcfa_d_a-debug.Tpo -c -o bits/libcfa_d_a-debug.o `test -f 'bits/debug.c' || echo '$(srcdir)/'`bits/debug.c
     707@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) bits/$(DEPDIR)/libcfa_d_a-debug.Tpo bits/$(DEPDIR)/libcfa_d_a-debug.Po
     708@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='bits/debug.c' object='bits/libcfa_d_a-debug.o' libtool=no @AMDEPBACKSLASH@
     709@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     710@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o bits/libcfa_d_a-debug.o `test -f 'bits/debug.c' || echo '$(srcdir)/'`bits/debug.c
     711
     712bits/libcfa_d_a-debug.obj: bits/debug.c
     713@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT bits/libcfa_d_a-debug.obj -MD -MP -MF bits/$(DEPDIR)/libcfa_d_a-debug.Tpo -c -o bits/libcfa_d_a-debug.obj `if test -f 'bits/debug.c'; then $(CYGPATH_W) 'bits/debug.c'; else $(CYGPATH_W) '$(srcdir)/bits/debug.c'; fi`
     714@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) bits/$(DEPDIR)/libcfa_d_a-debug.Tpo bits/$(DEPDIR)/libcfa_d_a-debug.Po
     715@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='bits/debug.c' object='bits/libcfa_d_a-debug.obj' libtool=no @AMDEPBACKSLASH@
     716@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     717@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o bits/libcfa_d_a-debug.obj `if test -f 'bits/debug.c'; then $(CYGPATH_W) 'bits/debug.c'; else $(CYGPATH_W) '$(srcdir)/bits/debug.c'; fi`
    719718
    720719libcfa_d_a-fstream.o: fstream.c
     
    998997@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-interpose.obj `if test -f 'interpose.c'; then $(CYGPATH_W) 'interpose.c'; else $(CYGPATH_W) '$(srcdir)/interpose.c'; fi`
    999998
    1000 libhdr/libcfa_a-libdebug.o: libhdr/libdebug.c
    1001 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libhdr/libcfa_a-libdebug.o -MD -MP -MF libhdr/$(DEPDIR)/libcfa_a-libdebug.Tpo -c -o libhdr/libcfa_a-libdebug.o `test -f 'libhdr/libdebug.c' || echo '$(srcdir)/'`libhdr/libdebug.c
    1002 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) libhdr/$(DEPDIR)/libcfa_a-libdebug.Tpo libhdr/$(DEPDIR)/libcfa_a-libdebug.Po
    1003 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='libhdr/libdebug.c' object='libhdr/libcfa_a-libdebug.o' libtool=no @AMDEPBACKSLASH@
    1004 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1005 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libhdr/libcfa_a-libdebug.o `test -f 'libhdr/libdebug.c' || echo '$(srcdir)/'`libhdr/libdebug.c
    1006 
    1007 libhdr/libcfa_a-libdebug.obj: libhdr/libdebug.c
    1008 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libhdr/libcfa_a-libdebug.obj -MD -MP -MF libhdr/$(DEPDIR)/libcfa_a-libdebug.Tpo -c -o libhdr/libcfa_a-libdebug.obj `if test -f 'libhdr/libdebug.c'; then $(CYGPATH_W) 'libhdr/libdebug.c'; else $(CYGPATH_W) '$(srcdir)/libhdr/libdebug.c'; fi`
    1009 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) libhdr/$(DEPDIR)/libcfa_a-libdebug.Tpo libhdr/$(DEPDIR)/libcfa_a-libdebug.Po
    1010 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='libhdr/libdebug.c' object='libhdr/libcfa_a-libdebug.obj' libtool=no @AMDEPBACKSLASH@
    1011 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1012 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libhdr/libcfa_a-libdebug.obj `if test -f 'libhdr/libdebug.c'; then $(CYGPATH_W) 'libhdr/libdebug.c'; else $(CYGPATH_W) '$(srcdir)/libhdr/libdebug.c'; fi`
     999bits/libcfa_a-debug.o: bits/debug.c
     1000@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT bits/libcfa_a-debug.o -MD -MP -MF bits/$(DEPDIR)/libcfa_a-debug.Tpo -c -o bits/libcfa_a-debug.o `test -f 'bits/debug.c' || echo '$(srcdir)/'`bits/debug.c
     1001@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) bits/$(DEPDIR)/libcfa_a-debug.Tpo bits/$(DEPDIR)/libcfa_a-debug.Po
     1002@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='bits/debug.c' object='bits/libcfa_a-debug.o' libtool=no @AMDEPBACKSLASH@
     1003@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1004@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o bits/libcfa_a-debug.o `test -f 'bits/debug.c' || echo '$(srcdir)/'`bits/debug.c
     1005
     1006bits/libcfa_a-debug.obj: bits/debug.c
     1007@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT bits/libcfa_a-debug.obj -MD -MP -MF bits/$(DEPDIR)/libcfa_a-debug.Tpo -c -o bits/libcfa_a-debug.obj `if test -f 'bits/debug.c'; then $(CYGPATH_W) 'bits/debug.c'; else $(CYGPATH_W) '$(srcdir)/bits/debug.c'; fi`
     1008@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) bits/$(DEPDIR)/libcfa_a-debug.Tpo bits/$(DEPDIR)/libcfa_a-debug.Po
     1009@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='bits/debug.c' object='bits/libcfa_a-debug.obj' libtool=no @AMDEPBACKSLASH@
     1010@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1011@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o bits/libcfa_a-debug.obj `if test -f 'bits/debug.c'; then $(CYGPATH_W) 'bits/debug.c'; else $(CYGPATH_W) '$(srcdir)/bits/debug.c'; fi`
    10131012
    10141013libcfa_a-fstream.o: fstream.c
     
    14111410        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
    14121411        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
     1412        -rm -f bits/$(DEPDIR)/$(am__dirstamp)
     1413        -rm -f bits/$(am__dirstamp)
    14131414        -rm -f concurrency/$(DEPDIR)/$(am__dirstamp)
    14141415        -rm -f concurrency/$(am__dirstamp)
    14151416        -rm -f containers/$(DEPDIR)/$(am__dirstamp)
    14161417        -rm -f containers/$(am__dirstamp)
    1417         -rm -f libhdr/$(DEPDIR)/$(am__dirstamp)
    1418         -rm -f libhdr/$(am__dirstamp)
    14191418
    14201419maintainer-clean-generic:
     
    14261425
    14271426distclean: distclean-am
    1428         -rm -rf ./$(DEPDIR) concurrency/$(DEPDIR) containers/$(DEPDIR) libhdr/$(DEPDIR)
     1427        -rm -rf ./$(DEPDIR) bits/$(DEPDIR) concurrency/$(DEPDIR) containers/$(DEPDIR)
    14291428        -rm -f Makefile
    14301429distclean-am: clean-am distclean-compile distclean-generic \
     
    14721471
    14731472maintainer-clean: maintainer-clean-am
    1474         -rm -rf ./$(DEPDIR) concurrency/$(DEPDIR) containers/$(DEPDIR) libhdr/$(DEPDIR)
     1473        -rm -rf ./$(DEPDIR) bits/$(DEPDIR) concurrency/$(DEPDIR) containers/$(DEPDIR)
    14751474        -rm -f Makefile
    14761475maintainer-clean-am: distclean-am maintainer-clean-generic \
  • src/libcfa/assert.c

    r389528b0 r35bae526  
    1717#include <stdarg.h>                                                             // varargs
    1818#include <stdio.h>                                                              // fprintf
    19 #include "libhdr/libdebug.h"
     19#include "bits/debug.h"
    2020
    2121extern "C" {
     
    2626        // called by macro assert in assert.h
    2727        void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {
    28                 __lib_debug_print_safe( CFA_ASSERT_FMT ".\n", __progname, function, line, file );
     28                __cfaabi_dbg_bits_print_safe( CFA_ASSERT_FMT ".\n", __progname, function, line, file );
    2929                abort();
    3030        }
     
    3232        // called by macro assertf
    3333        void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) {
    34                 __lib_debug_acquire();
    35                 __lib_debug_print_nolock( CFA_ASSERT_FMT ": ", __progname, function, line, file );
     34                __cfaabi_dbg_bits_acquire();
     35                __cfaabi_dbg_bits_print_nolock( CFA_ASSERT_FMT ": ", __progname, function, line, file );
    3636
    3737                va_list args;
    3838                va_start( args, fmt );
    39                 __lib_debug_print_vararg( fmt, args );
     39                __cfaabi_dbg_bits_print_vararg( fmt, args );
    4040                va_end( args );
    4141
    42                 __lib_debug_print_nolock( "\n" );
    43                 __lib_debug_release();
     42                __cfaabi_dbg_bits_print_nolock( "\n" );
     43                __cfaabi_dbg_bits_release();
    4444                abort();
    4545        }
  • src/libcfa/bits/locks.h

    r389528b0 r35bae526  
    1616#pragma once
    1717
     18#include "bits/debug.h"
    1819#include "bits/defs.h"
    1920
     
    6566
    6667        // Lock the spinlock, return false if already acquired
    67         static inline _Bool try_lock  ( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     68        static inline _Bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    6869                _Bool result = __lock_test_and_test_and_set( this.lock );
    69                 LIB_DEBUG_DO(
     70                __cfaabi_dbg_debug_do(
    7071                        if( result ) {
    7172                                this.prev_name = caller;
     
    7778
    7879        // Lock the spinlock, spin if already acquired
    79         static inline void lock( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     80        static inline void lock( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    8081                #ifndef NOEXPBACK
    8182                        enum { SPIN_START = 4, SPIN_END = 64 * 1024, };
     
    9899                        #endif
    99100                }
    100                 LIB_DEBUG_DO(
     101                __cfaabi_dbg_debug_do(
    101102                        this.prev_name = caller;
    102103                        this.prev_thrd = this_thread;
     
    105106
    106107        // Lock the spinlock, spin if already acquired
    107         static inline void lock_yield( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     108        static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    108109                for ( unsigned int i = 1;; i += 1 ) {
    109110                        if ( __lock_test_and_test_and_set( this.lock ) ) break;
    110111                        yield( i );
    111112                }
    112                 LIB_DEBUG_DO(
     113                __cfaabi_dbg_debug_do(
    113114                        this.prev_name = caller;
    114115                        this.prev_thrd = this_thread;
  • src/libcfa/concurrency/alarm.c

    r389528b0 r35bae526  
    110110}
    111111
    112 LIB_DEBUG_DO( bool validate( alarm_list_t * this ) {
     112__cfaabi_dbg_debug_do( bool validate( alarm_list_t * this ) {
    113113        alarm_node_t ** it = &this->head;
    114114        while( (*it) ) {
     
    186186
    187187        disable_interrupts();
    188         lock( event_kernel->lock DEBUG_CTX2 );
     188        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    189189        {
    190190                verify( validate( alarms ) );
     
    198198        unlock( event_kernel->lock );
    199199        this->set = true;
    200         enable_interrupts( DEBUG_CTX );
     200        enable_interrupts( __cfaabi_dbg_ctx );
    201201}
    202202
    203203void unregister_self( alarm_node_t * this ) {
    204204        disable_interrupts();
    205         lock( event_kernel->lock DEBUG_CTX2 );
     205        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    206206        {
    207207                verify( validate( &event_kernel->alarms ) );
     
    209209        }
    210210        unlock( event_kernel->lock );
    211         enable_interrupts( DEBUG_CTX );
     211        enable_interrupts( __cfaabi_dbg_ctx );
    212212        this->set = false;
    213213}
  • src/libcfa/concurrency/coroutine.c

    r389528b0 r35bae526  
    7676void ^?{}(coStack_t & this) {
    7777        if ( ! this.userStack && this.storage ) {
    78                 LIB_DEBUG_DO(
     78                __cfaabi_dbg_debug_do(
    7979                        if ( mprotect( this.storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {
    8080                                abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );
     
    131131
    132132                // assume malloc has 8 byte alignment so add 8 to allow rounding up to 16 byte alignment
    133                 LIB_DEBUG_DO( this->storage = memalign( pageSize, cxtSize + this->size + pageSize ) );
    134                 LIB_NO_DEBUG_DO( this->storage = malloc( cxtSize + this->size + 8 ) );
     133                __cfaabi_dbg_debug_do( this->storage = memalign( pageSize, cxtSize + this->size + pageSize ) );
     134                __cfaabi_dbg_no_debug_do( this->storage = malloc( cxtSize + this->size + 8 ) );
    135135
    136                 LIB_DEBUG_DO(
     136                __cfaabi_dbg_debug_do(
    137137                        if ( mprotect( this->storage, pageSize, PROT_NONE ) == -1 ) {
    138138                                abortf( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );
     
    144144                } // if
    145145
    146                 LIB_DEBUG_DO( this->limit = (char *)this->storage + pageSize );
    147                 LIB_NO_DEBUG_DO( this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ) ); // minimum alignment
     146                __cfaabi_dbg_debug_do( this->limit = (char *)this->storage + pageSize );
     147                __cfaabi_dbg_no_debug_do( this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ) ); // minimum alignment
    148148
    149149        } else {
  • src/libcfa/concurrency/invoke.c

    r389528b0 r35bae526  
    3131extern void __leave_thread_monitor( struct thread_desc * this );
    3232extern void disable_interrupts();
    33 extern void enable_interrupts( DEBUG_CTX_PARAM );
     33extern void enable_interrupts( __cfaabi_dbg_ctx_param );
    3434
    3535void CtxInvokeCoroutine(
    36       void (*main)(void *),
    37       struct coroutine_desc *(*get_coroutine)(void *),
    38       void *this
     36        void (*main)(void *),
     37        struct coroutine_desc *(*get_coroutine)(void *),
     38        void *this
    3939) {
    40       // LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
     40        struct coroutine_desc* cor = get_coroutine( this );
    4141
    42       struct coroutine_desc* cor = get_coroutine( this );
     42        if(cor->state == Primed) {
     43                __suspend_internal();
     44        }
    4345
    44       if(cor->state == Primed) {
    45             __suspend_internal();
    46       }
     46        cor->state = Active;
    4747
    48       cor->state = Active;
     48        main( this );
    4949
    50       main( this );
     50        cor->state = Halted;
    5151
    52       cor->state = Halted;
    53 
    54       //Final suspend, should never return
    55       __leave_coroutine();
    56       abortf("Resumed dead coroutine");
     52        //Final suspend, should never return
     53        __leave_coroutine();
     54        abortf("Resumed dead coroutine");
    5755}
    5856
    5957void CtxInvokeThread(
    60       void (*dtor)(void *),
    61       void (*main)(void *),
    62       struct thread_desc *(*get_thread)(void *),
    63       void *this
     58        void (*dtor)(void *),
     59        void (*main)(void *),
     60        struct thread_desc *(*get_thread)(void *),
     61        void *this
    6462) {
    65       // First suspend, once the thread arrives here,
    66       // the function pointer to main can be invalidated without risk
    67       __suspend_internal();
     63        // First suspend, once the thread arrives here,
     64        // the function pointer to main can be invalidated without risk
     65        __suspend_internal();
    6866
    69       // Fetch the thread handle from the user defined thread structure
    70       struct thread_desc* thrd = get_thread( this );
     67        // Fetch the thread handle from the user defined thread structure
     68        struct thread_desc* thrd = get_thread( this );
    7169
    72       // Officially start the thread by enabling preemption
    73       enable_interrupts( DEBUG_CTX );
     70        // Officially start the thread by enabling preemption
     71        enable_interrupts( __cfaabi_dbg_ctx );
    7472
    75       // Call the main of the thread
    76       main( this );
     73        // Call the main of the thread
     74        main( this );
    7775
    78       // To exit a thread we must :
    79       // 1 - Mark it as halted
    80       // 2 - Leave its monitor
    81       // 3 - Disable the interupts
    82       // 4 - Final suspend
    83       // The order of these 4 operations is very important
    84       //Final suspend, should never return
    85       __leave_thread_monitor( thrd );
    86       abortf("Resumed dead thread");
     76        // To exit a thread we must :
     77        // 1 - Mark it as halted
     78        // 2 - Leave its monitor
     79        // 3 - Disable the interupts
     80        // 4 - Final suspend
     81        // The order of these 4 operations is very important
     82        //Final suspend, should never return
     83        __leave_thread_monitor( thrd );
     84        abortf("Resumed dead thread");
    8785}
    8886
    8987
    9088void CtxStart(
    91       void (*main)(void *),
    92       struct coroutine_desc *(*get_coroutine)(void *),
    93       void *this,
    94       void (*invoke)(void *)
     89        void (*main)(void *),
     90        struct coroutine_desc *(*get_coroutine)(void *),
     91        void *this,
     92        void (*invoke)(void *)
    9593) {
    96       // LIB_DEBUG_PRINTF("StartCoroutine : Passing in %p (main %p) to invoke (%p) from start (%p)\n", this, main, invoke, CtxStart);
    97 
    98       struct coStack_t* stack = &get_coroutine( this )->stack;
     94        struct coStack_t* stack = &get_coroutine( this )->stack;
    9995
    10096#if defined( __i386__ )
     
    10399            void *fixedRegisters[3];                    // fixed registers ebx, edi, esi (popped on 1st uSwitch, values unimportant)
    104100            uint32_t mxcr;                        // SSE Status and Control bits (control bits are preserved across function calls)
    105           uint16_t fcw;                         // X97 FPU control word (preserved across function calls)
     101            uint16_t fcw;                         // X97 FPU control word (preserved across function calls)
    106102            void *rturn;                          // where to go on return from uSwitch
    107103            void *dummyReturn;                          // fake return compiler would have pushed on call to uInvoke
     
    116112        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->argument[0] = this;     // argument to invoke
    117113        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = invoke;
    118       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
    119       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
     114        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
     115        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    120116
    121117#elif defined( __x86_64__ )
    122118
    123       struct FakeStack {
    124             void *fixedRegisters[5];            // fixed registers rbx, r12, r13, r14, r15
    125             uint32_t mxcr;                      // SSE Status and Control bits (control bits are preserved across function calls)
    126             uint16_t fcw;                       // X97 FPU control word (preserved across function calls)
    127             void *rturn;                        // where to go on return from uSwitch
    128             void *dummyReturn;                  // NULL return address to provide proper alignment
    129       };
     119        struct FakeStack {
     120                void *fixedRegisters[5];            // fixed registers rbx, r12, r13, r14, r15
     121                uint32_t mxcr;                      // SSE Status and Control bits (control bits are preserved across function calls)
     122                uint16_t fcw;                       // X97 FPU control word (preserved across function calls)
     123                void *rturn;                        // where to go on return from uSwitch
     124                void *dummyReturn;                  // NULL return address to provide proper alignment
     125        };
    130126
    131       ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );
    132       ((struct machine_context_t *)stack->context)->FP = NULL;          // terminate stack with NULL fp
     127        ((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );
     128        ((struct machine_context_t *)stack->context)->FP = NULL;                // terminate stack with NULL fp
    133129
    134       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL;
    135       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub;
    136       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
    137       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
    138       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
    139       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
     130        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL;
     131        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub;
     132        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
     133        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
     134        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
     135        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    140136#else
    141       #error Only __i386__ and __x86_64__ is supported for threads in cfa
     137        #error Only __i386__ and __x86_64__ is supported for threads in cfa
    142138#endif
    143139}
  • src/libcfa/concurrency/kernel.c

    r389528b0 r35bae526  
    150150
    151151        this.runner = &runner;
    152         LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", &runner);
     152        __cfaabi_dbg_print_safe("Kernel : constructing main processor context %p\n", &runner);
    153153        runner{ &this };
    154154}
     
    156156void ^?{}(processor & this) {
    157157        if( ! this.do_terminate ) {
    158                 LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this);
     158                __cfaabi_dbg_print_safe("Kernel : core %p signaling termination\n", &this);
    159159                this.do_terminate = true;
    160160                P( this.terminated );
     
    181181        processor * this = runner.proc;
    182182
    183         LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this);
     183        __cfaabi_dbg_print_safe("Kernel : core %p starting\n", this);
    184184
    185185        {
     
    187187                preemption_scope scope = { this };
    188188
    189                 LIB_DEBUG_PRINT_SAFE("Kernel : core %p started\n", this);
     189                __cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
    190190
    191191                thread_desc * readyThread = NULL;
     
    213213                }
    214214
    215                 LIB_DEBUG_PRINT_SAFE("Kernel : core %p stopping\n", this);
     215                __cfaabi_dbg_print_safe("Kernel : core %p stopping\n", this);
    216216        }
    217217
    218218        V( this->terminated );
    219219
    220         LIB_DEBUG_PRINT_SAFE("Kernel : core %p terminated\n", this);
     220        __cfaabi_dbg_print_safe("Kernel : core %p terminated\n", this);
    221221}
    222222
     
    292292        processorCtx_t proc_cor_storage = { proc, &info };
    293293
    294         LIB_DEBUG_PRINT_SAFE("Coroutine : created stack %p\n", proc_cor_storage.__cor.stack.base);
     294        __cfaabi_dbg_print_safe("Coroutine : created stack %p\n", proc_cor_storage.__cor.stack.base);
    295295
    296296        //Set global state
     
    299299
    300300        //We now have a proper context from which to schedule threads
    301         LIB_DEBUG_PRINT_SAFE("Kernel : core %p created (%p, %p)\n", proc, proc->runner, &ctx);
     301        __cfaabi_dbg_print_safe("Kernel : core %p created (%p, %p)\n", proc, proc->runner, &ctx);
    302302
    303303        // SKULLDUGGERY: Since the coroutine doesn't have its own stack, we can't
     
    310310
    311311        // Main routine of the core returned, the core is now fully terminated
    312         LIB_DEBUG_PRINT_SAFE("Kernel : core %p main ended (%p)\n", proc, proc->runner);
     312        __cfaabi_dbg_print_safe("Kernel : core %p main ended (%p)\n", proc, proc->runner);
    313313
    314314        return NULL;
     
    316316
    317317void start(processor * this) {
    318         LIB_DEBUG_PRINT_SAFE("Kernel : Starting core %p\n", this);
     318        __cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
    319319
    320320        pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
    321321
    322         LIB_DEBUG_PRINT_SAFE("Kernel : core %p started\n", this);
     322        __cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
    323323}
    324324
     
    334334        verifyf( thrd->next == NULL, "Expected null got %p", thrd->next );
    335335
    336         lock(   this_processor->cltr->ready_queue_lock DEBUG_CTX2 );
     336        lock(   this_processor->cltr->ready_queue_lock __cfaabi_dbg_ctx2 );
    337337        append( this_processor->cltr->ready_queue, thrd );
    338338        unlock( this_processor->cltr->ready_queue_lock );
     
    343343thread_desc * nextThread(cluster * this) {
    344344        verify( disable_preempt_count > 0 );
    345         lock( this->ready_queue_lock DEBUG_CTX2 );
     345        lock( this->ready_queue_lock __cfaabi_dbg_ctx2 );
    346346        thread_desc * head = pop_head( this->ready_queue );
    347347        unlock( this->ready_queue_lock );
     
    355355        suspend();
    356356        verify( disable_preempt_count > 0 );
    357         enable_interrupts( DEBUG_CTX );
     357        enable_interrupts( __cfaabi_dbg_ctx );
    358358}
    359359
     
    367367        verify( disable_preempt_count > 0 );
    368368
    369         enable_interrupts( DEBUG_CTX );
     369        enable_interrupts( __cfaabi_dbg_ctx );
    370370}
    371371
     
    381381        verify( disable_preempt_count > 0 );
    382382
    383         enable_interrupts( DEBUG_CTX );
     383        enable_interrupts( __cfaabi_dbg_ctx );
    384384}
    385385
     
    395395        verify( disable_preempt_count > 0 );
    396396
    397         enable_interrupts( DEBUG_CTX );
     397        enable_interrupts( __cfaabi_dbg_ctx );
    398398}
    399399
     
    408408        verify( disable_preempt_count > 0 );
    409409
    410         enable_interrupts( DEBUG_CTX );
     410        enable_interrupts( __cfaabi_dbg_ctx );
    411411}
    412412
     
    423423        verify( disable_preempt_count > 0 );
    424424
    425         enable_interrupts( DEBUG_CTX );
     425        enable_interrupts( __cfaabi_dbg_ctx );
    426426}
    427427
     
    441441// Kernel boot procedures
    442442void kernel_startup(void) {
    443         LIB_DEBUG_PRINT_SAFE("Kernel : Starting\n");
     443        __cfaabi_dbg_print_safe("Kernel : Starting\n");
    444444
    445445        // Start by initializing the main thread
     
    450450        (*mainThread){ &info };
    451451
    452         LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n");
     452        __cfaabi_dbg_print_safe("Kernel : Main thread ready\n");
    453453
    454454        // Initialize the main cluster
     
    456456        (*mainCluster){};
    457457
    458         LIB_DEBUG_PRINT_SAFE("Kernel : main cluster ready\n");
     458        __cfaabi_dbg_print_safe("Kernel : main cluster ready\n");
    459459
    460460        // Initialize the main processor and the main processor ctx
     
    483483
    484484        // THE SYSTEM IS NOW COMPLETELY RUNNING
    485         LIB_DEBUG_PRINT_SAFE("Kernel : Started\n--------------------------------------------------\n\n");
    486 
    487         enable_interrupts( DEBUG_CTX );
     485        __cfaabi_dbg_print_safe("Kernel : Started\n--------------------------------------------------\n\n");
     486
     487        enable_interrupts( __cfaabi_dbg_ctx );
    488488}
    489489
    490490void kernel_shutdown(void) {
    491         LIB_DEBUG_PRINT_SAFE("\n--------------------------------------------------\nKernel : Shutting down\n");
     491        __cfaabi_dbg_print_safe("\n--------------------------------------------------\nKernel : Shutting down\n");
    492492
    493493        disable_interrupts();
     
    513513        ^(mainThread){};
    514514
    515         LIB_DEBUG_PRINT_SAFE("Kernel : Shutdown complete\n");
     515        __cfaabi_dbg_print_safe("Kernel : Shutdown complete\n");
    516516}
    517517
     
    523523        // abort cannot be recursively entered by the same or different processors because all signal handlers return when
    524524        // the globalAbort flag is true.
    525         lock( kernel_abort_lock DEBUG_CTX2 );
     525        lock( kernel_abort_lock __cfaabi_dbg_ctx2 );
    526526
    527527        // first task to abort ?
     
    548548
    549549        int len = snprintf( abort_text, abort_text_size, "Error occurred while executing task %.256s (%p)", thrd->self_cor.name, thrd );
    550         __lib_debug_write( abort_text, len );
     550        __cfaabi_dbg_bits_write( abort_text, len );
    551551
    552552        if ( thrd != this_coroutine ) {
    553553                len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", this_coroutine->name, this_coroutine );
    554                 __lib_debug_write( abort_text, len );
     554                __cfaabi_dbg_bits_write( abort_text, len );
    555555        }
    556556        else {
    557                 __lib_debug_write( ".\n", 2 );
     557                __cfaabi_dbg_bits_write( ".\n", 2 );
    558558        }
    559559}
    560560
    561561extern "C" {
    562         void __lib_debug_acquire() {
    563                 lock( kernel_debug_lock DEBUG_CTX2 );
    564         }
    565 
    566         void __lib_debug_release() {
     562        void __cfaabi_dbg_bits_acquire() {
     563                lock( kernel_debug_lock __cfaabi_dbg_ctx2 );
     564        }
     565
     566        void __cfaabi_dbg_bits_release() {
    567567                unlock( kernel_debug_lock );
    568568        }
     
    582582
    583583void P(semaphore & this) {
    584         lock( this.lock DEBUG_CTX2 );
     584        lock( this.lock __cfaabi_dbg_ctx2 );
    585585        this.count -= 1;
    586586        if ( this.count < 0 ) {
     
    598598void V(semaphore & this) {
    599599        thread_desc * thrd = NULL;
    600         lock( this.lock DEBUG_CTX2 );
     600        lock( this.lock __cfaabi_dbg_ctx2 );
    601601        this.count += 1;
    602602        if ( this.count <= 0 ) {
  • src/libcfa/concurrency/kernel_private.h

    r389528b0 r35bae526  
    3030        void disable_interrupts();
    3131        void enable_interrupts_noPoll();
    32         void enable_interrupts( DEBUG_CTX_PARAM );
     32        void enable_interrupts( __cfaabi_dbg_ctx_param );
    3333}
    3434
     
    3939        disable_interrupts();
    4040        ScheduleThread( thrd );
    41         enable_interrupts( DEBUG_CTX );
     41        enable_interrupts( __cfaabi_dbg_ctx );
    4242}
    4343thread_desc * nextThread(cluster * this);
  • src/libcfa/concurrency/monitor.c

    r389528b0 r35bae526  
    9191        static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) {
    9292                // Lock the monitor spinlock
    93                 DO_LOCK( this->lock DEBUG_CTX2 );
     93                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    9494                thread_desc * thrd = this_thread;
    9595
    96                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner);
     96                __cfaabi_dbg_print_safe("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner);
    9797
    9898                if( !this->owner ) {
     
    100100                        set_owner( this, thrd );
    101101
    102                         LIB_DEBUG_PRINT_SAFE("Kernel :  mon is free \n");
     102                        __cfaabi_dbg_print_safe("Kernel :  mon is free \n");
    103103                }
    104104                else if( this->owner == thrd) {
     
    106106                        this->recursion += 1;
    107107
    108                         LIB_DEBUG_PRINT_SAFE("Kernel :  mon already owned \n");
     108                        __cfaabi_dbg_print_safe("Kernel :  mon already owned \n");
    109109                }
    110110                else if( is_accepted( this, group) ) {
     
    115115                        reset_mask( this );
    116116
    117                         LIB_DEBUG_PRINT_SAFE("Kernel :  mon accepts \n");
     117                        __cfaabi_dbg_print_safe("Kernel :  mon accepts \n");
    118118                }
    119119                else {
    120                         LIB_DEBUG_PRINT_SAFE("Kernel :  blocking \n");
     120                        __cfaabi_dbg_print_safe("Kernel :  blocking \n");
    121121
    122122                        // Some one else has the monitor, wait in line for it
     
    124124                        BlockInternal( &this->lock );
    125125
    126                         LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entered  mon %p\n", thrd, this);
     126                        __cfaabi_dbg_print_safe("Kernel : %10p Entered  mon %p\n", thrd, this);
    127127
    128128                        // BlockInternal will unlock spinlock, no need to unlock ourselves
     
    130130                }
    131131
    132                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entered  mon %p\n", thrd, this);
     132                __cfaabi_dbg_print_safe("Kernel : %10p Entered  mon %p\n", thrd, this);
    133133
    134134                // Release the lock and leave
     
    139139        static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) {
    140140                // Lock the monitor spinlock
    141                 DO_LOCK( this->lock DEBUG_CTX2 );
     141                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    142142                thread_desc * thrd = this_thread;
    143143
    144                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Entering dtor for mon %p (%p)\n", thrd, this, this->owner);
     144                __cfaabi_dbg_print_safe("Kernel : %10p Entering dtor for mon %p (%p)\n", thrd, this, this->owner);
    145145
    146146
    147147                if( !this->owner ) {
    148                         LIB_DEBUG_PRINT_SAFE("Kernel : Destroying free mon %p\n", this);
     148                        __cfaabi_dbg_print_safe("Kernel : Destroying free mon %p\n", this);
    149149
    150150                        // No one has the monitor, just take it
     
    164164                __monitor_group_t group = { &this, 1, func };
    165165                if( is_accepted( this, group) ) {
    166                         LIB_DEBUG_PRINT_SAFE("Kernel :  mon accepts dtor, block and signal it \n");
     166                        __cfaabi_dbg_print_safe("Kernel :  mon accepts dtor, block and signal it \n");
    167167
    168168                        // Wake the thread that is waiting for this
     
    183183                }
    184184                else {
    185                         LIB_DEBUG_PRINT_SAFE("Kernel :  blocking \n");
     185                        __cfaabi_dbg_print_safe("Kernel :  blocking \n");
    186186
    187187                        wait_ctx( this_thread, 0 )
     
    196196                }
    197197
    198                 LIB_DEBUG_PRINT_SAFE("Kernel : Destroying %p\n", this);
     198                __cfaabi_dbg_print_safe("Kernel : Destroying %p\n", this);
    199199
    200200        }
     
    203203        void __leave_monitor_desc( monitor_desc * this ) {
    204204                // Lock the monitor spinlock, DO_LOCK to reduce contention
    205                 DO_LOCK( this->lock DEBUG_CTX2 );
    206 
    207                 LIB_DEBUG_PRINT_SAFE("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner);
     205                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
     206
     207                __cfaabi_dbg_print_safe("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner);
    208208
    209209                verifyf( this_thread == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", this_thread, this->owner, this->recursion, this );
     
    215215                // it means we don't need to do anything
    216216                if( this->recursion != 0) {
    217                         LIB_DEBUG_PRINT_SAFE("Kernel :  recursion still %d\n", this->recursion);
     217                        __cfaabi_dbg_print_safe("Kernel :  recursion still %d\n", this->recursion);
    218218                        unlock( this->lock );
    219219                        return;
     
    232232        // Leave single monitor for the last time
    233233        void __leave_dtor_monitor_desc( monitor_desc * this ) {
    234                 LIB_DEBUG_DO(
     234                __cfaabi_dbg_debug_do(
    235235                        if( this_thread != this->owner ) {
    236236                                abortf("Destroyed monitor %p has inconsistent owner, expected %p got %p.\n", this, this_thread, this->owner);
     
    249249
    250250                // Lock the monitor now
    251                 DO_LOCK( this->lock DEBUG_CTX2 );
     251                DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
    252252
    253253                disable_interrupts();
     
    308308        (this_thread->monitors){m, count, func};
    309309
    310         // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count);
     310        // __cfaabi_dbg_print_safe("MGUARD : enter %d\n", count);
    311311
    312312        // Enter the monitors in order
     
    314314        enter( group );
    315315
    316         // LIB_DEBUG_PRINT_SAFE("MGUARD : entered\n");
     316        // __cfaabi_dbg_print_safe("MGUARD : entered\n");
    317317}
    318318
     
    320320// Dtor for monitor guard
    321321void ^?{}( monitor_guard_t & this ) {
    322         // LIB_DEBUG_PRINT_SAFE("MGUARD : leaving %d\n", this.count);
     322        // __cfaabi_dbg_print_safe("MGUARD : leaving %d\n", this.count);
    323323
    324324        // Leave the monitors in order
    325325        leave( this.m, this.count );
    326326
    327         // LIB_DEBUG_PRINT_SAFE("MGUARD : left\n");
     327        // __cfaabi_dbg_print_safe("MGUARD : left\n");
    328328
    329329        // Restore thread context
     
    430430
    431431        //Some more checking in debug
    432         LIB_DEBUG_DO(
     432        __cfaabi_dbg_debug_do(
    433433                thread_desc * this_thrd = this_thread;
    434434                if ( this.monitor_count != this_thrd->monitors.size ) {
     
    487487        set_owner( monitors, count, signallee );
    488488
    489         LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : signal_block condition %p (s: %p)\n", &this, signallee );
     489        __cfaabi_dbg_print_buffer_decl( "Kernel : signal_block condition %p (s: %p)\n", &this, signallee );
    490490
    491491        //Everything is ready to go to sleep
     
    496496
    497497
    498         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel :   signal_block returned\n" );
     498        __cfaabi_dbg_print_buffer_local( "Kernel :   signal_block returned\n" );
    499499
    500500        //We are back, restore the masks and recursions
     
    535535        __lock_size_t actual_count = aggregate( mon_storage, mask );
    536536
    537         LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (__lock_size_t)max);
     537        __cfaabi_dbg_print_buffer_decl( "Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (__lock_size_t)max);
    538538
    539539        if(actual_count == 0) return;
    540540
    541         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : waitfor internal proceeding\n");
     541        __cfaabi_dbg_print_buffer_local( "Kernel : waitfor internal proceeding\n");
    542542
    543543        // Create storage for monitor context
     
    556556                        __acceptable_t& accepted = mask[index];
    557557                        if( accepted.is_dtor ) {
    558                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : dtor already there\n");
     558                                __cfaabi_dbg_print_buffer_local( "Kernel : dtor already there\n");
    559559                                verifyf( accepted.size == 1,  "ERROR: Accepted dtor has more than 1 mutex parameter." );
    560560
     
    568568                        }
    569569                        else {
    570                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : thread present, baton-passing\n");
     570                                __cfaabi_dbg_print_buffer_local( "Kernel : thread present, baton-passing\n");
    571571
    572572                                // Create the node specific to this wait operation
     
    576576                                monitor_save;
    577577
    578                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel :  baton of %d monitors : ", count );
     578                                __cfaabi_dbg_print_buffer_local( "Kernel :  baton of %d monitors : ", count );
    579579                                #ifdef __CFA_DEBUG_PRINT__
    580580                                        for( int i = 0; i < count; i++) {
    581                                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "%p %p ", monitors[i], monitors[i]->signal_stack.top );
     581                                                __cfaabi_dbg_print_buffer_local( "%p %p ", monitors[i], monitors[i]->signal_stack.top );
    582582                                        }
    583583                                #endif
    584                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "\n");
     584                                __cfaabi_dbg_print_buffer_local( "\n");
    585585
    586586                                // Set the owners to be the next thread
     
    593593                                monitor_restore;
    594594
    595                                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : thread present, returned\n");
     595                                __cfaabi_dbg_print_buffer_local( "Kernel : thread present, returned\n");
    596596                        }
    597597
    598                         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
     598                        __cfaabi_dbg_print_buffer_local( "Kernel : accepted %d\n", *mask.accepted);
    599599                        return;
    600600                }
     
    603603
    604604        if( duration == 0 ) {
    605                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : non-blocking, exiting\n");
     605                __cfaabi_dbg_print_buffer_local( "Kernel : non-blocking, exiting\n");
    606606
    607607                unlock_all( locks, count );
    608608
    609                 LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
     609                __cfaabi_dbg_print_buffer_local( "Kernel : accepted %d\n", *mask.accepted);
    610610                return;
    611611        }
     
    614614        verifyf( duration < 0, "Timeout on waitfor statments not supported yet.");
    615615
    616         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : blocking waitfor\n");
     616        __cfaabi_dbg_print_buffer_local( "Kernel : blocking waitfor\n");
    617617
    618618        // Create the node specific to this wait operation
     
    636636        monitor_restore;
    637637
    638         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : exiting\n");
    639 
    640         LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel : accepted %d\n", *mask.accepted);
     638        __cfaabi_dbg_print_buffer_local( "Kernel : exiting\n");
     639
     640        __cfaabi_dbg_print_buffer_local( "Kernel : accepted %d\n", *mask.accepted);
    641641}
    642642
     
    645645
    646646static inline void set_owner( monitor_desc * this, thread_desc * owner ) {
    647         // LIB_DEBUG_PRINT_SAFE("Kernal :   Setting owner of %p to %p ( was %p)\n", this, owner, this->owner );
     647        // __cfaabi_dbg_print_safe("Kernal :   Setting owner of %p to %p ( was %p)\n", this, owner, this->owner );
    648648
    649649        //Pass the monitor appropriately
     
    677677static inline thread_desc * next_thread( monitor_desc * this ) {
    678678        //Check the signaller stack
    679         LIB_DEBUG_PRINT_SAFE("Kernel :  mon %p AS-stack top %p\n", this, this->signal_stack.top);
     679        __cfaabi_dbg_print_safe("Kernel :  mon %p AS-stack top %p\n", this, this->signal_stack.top);
    680680        __condition_criterion_t * urgent = pop( this->signal_stack );
    681681        if( urgent ) {
     
    729729        for( __lock_size_t i = 0; i < count; i++) {
    730730                (criteria[i]){ monitors[i], waiter };
    731                 LIB_DEBUG_PRINT_SAFE( "Kernel :  target %p = %p\n", criteria[i].target, &criteria[i] );
     731                __cfaabi_dbg_print_safe( "Kernel :  target %p = %p\n", criteria[i].target, &criteria[i] );
    732732                push( criteria[i].target->signal_stack, &criteria[i] );
    733733        }
     
    738738static inline void lock_all( __spinlock_t * locks [], __lock_size_t count ) {
    739739        for( __lock_size_t i = 0; i < count; i++ ) {
    740                 DO_LOCK( *locks[i] DEBUG_CTX2 );
     740                DO_LOCK( *locks[i] __cfaabi_dbg_ctx2 );
    741741        }
    742742}
     
    745745        for( __lock_size_t i = 0; i < count; i++ ) {
    746746                __spinlock_t * l = &source[i]->lock;
    747                 DO_LOCK( *l DEBUG_CTX2 );
     747                DO_LOCK( *l __cfaabi_dbg_ctx2 );
    748748                if(locks) locks[i] = l;
    749749        }
     
    803803        for(    int i = 0; i < count; i++ ) {
    804804
    805                 // LIB_DEBUG_PRINT_SAFE( "Checking %p for %p\n", &criteria[i], target );
     805                // __cfaabi_dbg_print_safe( "Checking %p for %p\n", &criteria[i], target );
    806806                if( &criteria[i] == target ) {
    807807                        criteria[i].ready = true;
    808                         // LIB_DEBUG_PRINT_SAFE( "True\n" );
     808                        // __cfaabi_dbg_print_safe( "True\n" );
    809809                }
    810810
     
    812812        }
    813813
    814         LIB_DEBUG_PRINT_SAFE( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
     814        __cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
    815815        return ready2run ? node->waiting_thread : NULL;
    816816}
     
    819819        thread_desc * thrd = this_thread;
    820820        if( !this.monitors ) {
    821                 // LIB_DEBUG_PRINT_SAFE("Branding\n");
     821                // __cfaabi_dbg_print_safe("Branding\n");
    822822                assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data );
    823823                this.monitor_count = thrd->monitors.size;
  • src/libcfa/concurrency/preemption.c

    r389528b0 r35bae526  
    148148//=============================================================================================
    149149
    150 LIB_DEBUG_DO( static thread_local void * last_interrupt = 0; )
     150__cfaabi_dbg_debug_do( static thread_local void * last_interrupt = 0; )
    151151
    152152extern "C" {
     
    159159        // Enable interrupts by decrementing the counter
    160160        // If counter reaches 0, execute any pending CtxSwitch
    161         void enable_interrupts( DEBUG_CTX_PARAM ) {
     161        void enable_interrupts( __cfaabi_dbg_ctx_param ) {
    162162                processor * proc   = this_processor;      // Cache the processor now since interrupts can start happening after the atomic add
    163163                thread_desc * thrd = this_thread;         // Cache the thread now since interrupts can start happening after the atomic add
     
    173173
    174174                // For debugging purposes : keep track of the last person to enable the interrupts
    175                 LIB_DEBUG_DO( proc->last_enable = caller; )
     175                __cfaabi_dbg_debug_do( proc->last_enable = caller; )
    176176        }
    177177
     
    233233// Called from kernel_startup
    234234void kernel_start_preemption() {
    235         LIB_DEBUG_PRINT_SAFE("Kernel : Starting preemption\n");
     235        __cfaabi_dbg_print_safe("Kernel : Starting preemption\n");
    236236
    237237        // Start with preemption disabled until ready
     
    255255// Called from kernel_shutdown
    256256void kernel_stop_preemption() {
    257         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption stopping\n");
     257        __cfaabi_dbg_print_safe("Kernel : Preemption stopping\n");
    258258
    259259        // Block all signals since we are already shutting down
     
    271271        // Preemption is now fully stopped
    272272
    273         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption stopped\n");
     273        __cfaabi_dbg_print_safe("Kernel : Preemption stopped\n");
    274274}
    275275
     
    297297// Receives SIGUSR1 signal and causes the current thread to yield
    298298void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
    299         LIB_DEBUG_DO( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
     299        __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
    300300
    301301        // Check if it is safe to preempt here
     
    346346                assertf(sig == SIGALRM, "Kernel Internal Error, sigwait: Unexpected signal %d (%d : %d)\n", sig, info.si_code, info.si_value.sival_int);
    347347
    348                 // LIB_DEBUG_PRINT_SAFE("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
     348                // __cfaabi_dbg_print_safe("Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );
    349349                // Switch on the code (a.k.a. the sender) to
    350350                switch( info.si_code )
     
    354354                case SI_TIMER:
    355355                case SI_KERNEL:
    356                         // LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread tick\n");
    357                         lock( event_kernel->lock DEBUG_CTX2 );
     356                        // __cfaabi_dbg_print_safe("Kernel : Preemption thread tick\n");
     357                        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    358358                        tick_preemption();
    359359                        unlock( event_kernel->lock );
     
    368368
    369369EXIT:
    370         LIB_DEBUG_PRINT_SAFE("Kernel : Preemption thread stopping\n");
     370        __cfaabi_dbg_print_safe("Kernel : Preemption thread stopping\n");
    371371        return NULL;
    372372}
     
    380380
    381381        if ( sigaction( sig, &act, NULL ) == -1 ) {
    382                 LIB_DEBUG_PRINT_BUFFER_DECL(
     382                __cfaabi_dbg_print_buffer_decl(
    383383                        " __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
    384384                        sig, handler, flags, errno, strerror( errno )
     
    397397
    398398        if ( sigaction( sig, &act, NULL ) == -1 ) {
    399                 LIB_DEBUG_PRINT_BUFFER_DECL(
     399                __cfaabi_dbg_print_buffer_decl(
    400400                        " __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",
    401401                        sig, errno, strerror( errno )
     
    409409//=============================================================================================
    410410
    411 LIB_DEBUG_DO(
     411__cfaabi_dbg_debug_do(
    412412        static void __kernel_backtrace( int start ) {
    413413                // skip first N stack frames
     
    476476
    477477// void sigHandler_segv( __CFA_SIGPARMS__ ) {
    478 //      LIB_DEBUG_DO(
     478//      __cfaabi_dbg_debug_do(
    479479//              #ifdef __USE_STREAM__
    480480//              serr    | "*CFA runtime error* program cfa-cpp terminated with"
     
    493493// void sigHandler_abort( __CFA_SIGPARMS__ ) {
    494494//      // skip first 6 stack frames
    495 //      LIB_DEBUG_DO( __kernel_backtrace( 6 ); )
     495//      __cfaabi_dbg_debug_do( __kernel_backtrace( 6 ); )
    496496
    497497//      // reset default signal handler
  • src/libcfa/concurrency/thread.c

    r389528b0 r35bae526  
    7272        thrd_c->last = this_coroutine;
    7373
    74         // LIB_DEBUG_PRINT_SAFE("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
     74        // __cfaabi_dbg_print_safe("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
    7575
    7676        disable_interrupts();
     
    8282
    8383        ScheduleThread(thrd_h);
    84         enable_interrupts( DEBUG_CTX );
     84        enable_interrupts( __cfaabi_dbg_ctx );
    8585}
    8686
  • src/libcfa/exception.c

    r389528b0 r35bae526  
    2323#include <stdio.h>
    2424#include <unwind.h>
    25 #include <libhdr/libdebug.h>
     25#include <bits/debug.h>
    2626
    2727// FIX ME: temporary hack to keep ARM build working
     
    3737
    3838// Base exception vtable is abstract, you should not have base exceptions.
    39 struct __cfaehm__base_exception_t_vtable
    40                 ___cfaehm__base_exception_t_vtable_instance = {
     39struct __cfaabi_ehm__base_exception_t_vtable
     40                ___cfaabi_ehm__base_exception_t_vtable_instance = {
    4141        .parent = NULL,
    4242        .size = 0,
     
    4949// Temperary global exception context. Does not work with concurency.
    5050struct exception_context_t {
    51     struct __cfaehm__try_resume_node * top_resume;
    52     struct __cfaehm__try_resume_node * current_resume;
     51    struct __cfaabi_ehm__try_resume_node * top_resume;
     52    struct __cfaabi_ehm__try_resume_node * current_resume;
    5353
    5454    exception * current_exception;
     
    7878// RESUMPTION ================================================================
    7979
    80 void __cfaehm__throw_resume(exception * except) {
    81 
    82         LIB_DEBUG_PRINT_SAFE("Throwing resumption exception\n");
    83 
    84         struct __cfaehm__try_resume_node * original_head = shared_stack.current_resume;
    85         struct __cfaehm__try_resume_node * current =
     80void __cfaabi_ehm__throw_resume(exception * except) {
     81
     82        __cfaabi_dbg_print_safe("Throwing resumption exception\n");
     83
     84        struct __cfaabi_ehm__try_resume_node * original_head = shared_stack.current_resume;
     85        struct __cfaabi_ehm__try_resume_node * current =
    8686                (original_head) ? original_head->next : shared_stack.top_resume;
    8787
     
    9494        }
    9595
    96         LIB_DEBUG_PRINT_SAFE("Unhandled exception\n");
     96        __cfaabi_dbg_print_safe("Unhandled exception\n");
    9797        shared_stack.current_resume = original_head;
    9898
    9999        // Fall back to termination:
    100         __cfaehm__throw_terminate(except);
     100        __cfaabi_ehm__throw_terminate(except);
    101101        // TODO: Default handler for resumption.
    102102}
     
    105105// hook has to be added after the node is built but before it is made the top node.
    106106
    107 void __cfaehm__try_resume_setup(struct __cfaehm__try_resume_node * node,
     107void __cfaabi_ehm__try_resume_setup(struct __cfaabi_ehm__try_resume_node * node,
    108108                        _Bool (*handler)(exception * except)) {
    109109        node->next = shared_stack.top_resume;
     
    112112}
    113113
    114 void __cfaehm__try_resume_cleanup(struct __cfaehm__try_resume_node * node) {
     114void __cfaabi_ehm__try_resume_cleanup(struct __cfaabi_ehm__try_resume_node * node) {
    115115        shared_stack.top_resume = node->next;
    116116}
     
    122122// May have to move to cfa for constructors and destructors (references).
    123123
    124 struct __cfaehm__node {
    125         struct __cfaehm__node * next;
     124struct __cfaabi_ehm__node {
     125        struct __cfaabi_ehm__node * next;
    126126};
    127127
    128128#define NODE_TO_EXCEPT(node) ((exception *)(1 + (node)))
    129 #define EXCEPT_TO_NODE(except) ((struct __cfaehm__node *)(except) - 1)
     129#define EXCEPT_TO_NODE(except) ((struct __cfaabi_ehm__node *)(except) - 1)
    130130
    131131// Creates a copy of the indicated exception and sets current_exception to it.
    132 static void __cfaehm__allocate_exception( exception * except ) {
     132static void __cfaabi_ehm__allocate_exception( exception * except ) {
    133133        struct exception_context_t * context = this_exception_context();
    134134
    135135        // Allocate memory for the exception.
    136         struct __cfaehm__node * store = malloc(
    137                 sizeof( struct __cfaehm__node ) + except->virtual_table->size );
     136        struct __cfaabi_ehm__node * store = malloc(
     137                sizeof( struct __cfaabi_ehm__node ) + except->virtual_table->size );
    138138
    139139        if ( ! store ) {
     
    151151
    152152// Delete the provided exception, unsetting current_exception if relivant.
    153 static void __cfaehm__delete_exception( exception * except ) {
     153static void __cfaabi_ehm__delete_exception( exception * except ) {
    154154        struct exception_context_t * context = this_exception_context();
    155155
    156         LIB_DEBUG_PRINT_SAFE("Deleting Exception\n");
     156        __cfaabi_dbg_print_safe("Deleting Exception\n");
    157157
    158158        // Remove the exception from the list.
    159         struct __cfaehm__node * to_free = EXCEPT_TO_NODE(except);
    160         struct __cfaehm__node * node;
     159        struct __cfaabi_ehm__node * to_free = EXCEPT_TO_NODE(except);
     160        struct __cfaabi_ehm__node * node;
    161161
    162162        if ( context->current_exception == except ) {
     
    178178
    179179// If this isn't a rethrow (*except==0), delete the provided exception.
    180 void __cfaehm__cleanup_terminate( void * except ) {
    181         if ( *(void**)except ) __cfaehm__delete_exception( *(exception**)except );
     180void __cfaabi_ehm__cleanup_terminate( void * except ) {
     181        if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception**)except );
    182182}
    183183
     
    202202
    203203// The exception that is being thrown must already be stored.
    204 __attribute__((noreturn)) void __cfaehm__begin_unwind(void) {
     204__attribute__((noreturn)) void __cfaabi_ehm__begin_unwind(void) {
    205205        if ( ! this_exception_context()->current_exception ) {
    206206                printf("UNWIND ERROR missing exception in begin unwind\n");
     
    233233}
    234234
    235 void __cfaehm__throw_terminate( exception * val ) {
    236         LIB_DEBUG_PRINT_SAFE("Throwing termination exception\n");
    237 
    238         __cfaehm__allocate_exception( val );
    239         __cfaehm__begin_unwind();
    240 }
    241 
    242 void __cfaehm__rethrow_terminate(void) {
    243         LIB_DEBUG_PRINT_SAFE("Rethrowing termination exception\n");
    244 
    245         __cfaehm__begin_unwind();
     235void __cfaabi_ehm__throw_terminate( exception * val ) {
     236        __cfaabi_dbg_print_safe("Throwing termination exception\n");
     237
     238        __cfaabi_ehm__allocate_exception( val );
     239        __cfaabi_ehm__begin_unwind();
     240}
     241
     242void __cfaabi_ehm__rethrow_terminate(void) {
     243        __cfaabi_dbg_print_safe("Rethrowing termination exception\n");
     244
     245        __cfaabi_ehm__begin_unwind();
    246246}
    247247
     
    254254{
    255255
    256         //LIB_DEBUG_PRINT_SAFE("CFA: 0x%lx\n", _Unwind_GetCFA(context));
    257         LIB_DEBUG_PRINT_SAFE("Personality function (%d, %x, %llu, %p, %p):", version, actions, exceptionClass, unwind_exception, context);
     256        //__cfaabi_dbg_print_safe("CFA: 0x%lx\n", _Unwind_GetCFA(context));
     257        __cfaabi_dbg_print_safe("Personality function (%d, %x, %llu, %p, %p):", version, actions, exceptionClass, unwind_exception, context);
    258258
    259259        // If we've reached the end of the stack then there is nothing much we can do...
     
    261261
    262262        if (actions & _UA_SEARCH_PHASE) {
    263                 LIB_DEBUG_PRINT_SAFE(" lookup phase");
     263                __cfaabi_dbg_print_safe(" lookup phase");
    264264        }
    265265        else if (actions & _UA_CLEANUP_PHASE) {
    266                 LIB_DEBUG_PRINT_SAFE(" cleanup phase");
     266                __cfaabi_dbg_print_safe(" cleanup phase");
    267267        }
    268268        // Just in case, probably can't actually happen
     
    307307                        void * ep = (void*)lsd_info.Start + callsite_start + callsite_len;
    308308                        void * ip = (void*)instruction_ptr;
    309                         LIB_DEBUG_PRINT_SAFE("\nfound %p - %p (%p, %p, %p), looking for %p\n", bp, ep, ls, cs, cl, ip);
     309                        __cfaabi_dbg_print_safe("\nfound %p - %p (%p, %p, %p), looking for %p\n", bp, ep, ls, cs, cl, ip);
    310310#endif // __CFA_DEBUG_PRINT__
    311311                        continue;
     
    346346
    347347                                        // Get a function pointer from the relative offset and call it
    348                                         // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher;                                   
     348                                        // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher;
    349349
    350350                                        _Unwind_Reason_Code (*matcher)(exception *) =
     
    357357                                        // Based on the return value, check if we matched the exception
    358358                                        if( ret == _URC_HANDLER_FOUND) {
    359                                                 LIB_DEBUG_PRINT_SAFE(" handler found\n");
     359                                                __cfaabi_dbg_print_safe(" handler found\n");
    360360                                        } else {
    361                                                 LIB_DEBUG_PRINT_SAFE(" no handler\n");
     361                                                __cfaabi_dbg_print_safe(" no handler\n");
    362362                                        }
    363363                                        return ret;
     
    365365
    366366                                // This is only a cleanup handler, ignore it
    367                                 LIB_DEBUG_PRINT_SAFE(" no action");
     367                                __cfaabi_dbg_print_safe(" no action");
    368368                        }
    369369                        else if (actions & _UA_CLEANUP_PHASE) {
     
    385385                                _Unwind_SetIP( context, ((lsd_info.LPStart) + (callsite_landing_pad)) );
    386386
    387                                 LIB_DEBUG_PRINT_SAFE(" action\n");
     387                                __cfaabi_dbg_print_safe(" action\n");
    388388
    389389                                // Return have some action to run
     
    393393
    394394                // Nothing to do, move along
    395                 LIB_DEBUG_PRINT_SAFE(" no landing pad");
     395                __cfaabi_dbg_print_safe(" no landing pad");
    396396        }
    397397        // No handling found
    398         LIB_DEBUG_PRINT_SAFE(" table end reached\n");
     398        __cfaabi_dbg_print_safe(" table end reached\n");
    399399
    400400        UNWIND:
    401         LIB_DEBUG_PRINT_SAFE(" unwind\n");
     401        __cfaabi_dbg_print_safe(" unwind\n");
    402402
    403403        // Keep unwinding the stack
     
    408408// libcfa but there is one problem left, see the exception table for details
    409409__attribute__((noinline))
    410 void __cfaehm__try_terminate(void (*try_block)(),
     410void __cfaabi_ehm__try_terminate(void (*try_block)(),
    411411                void (*catch_block)(int index, exception * except),
    412412                __attribute__((unused)) int (*match_block)(exception * except)) {
     
    466466        // Body uses language specific data and therefore could be modified arbitrarily
    467467        ".LLSDACSBCFA2:\n"                                              // BODY start
    468         "       .uleb128 .TRYSTART-__cfaehm__try_terminate\n"           // Handled area start  (relative to start of function)
     468        "       .uleb128 .TRYSTART-__cfaabi_ehm__try_terminate\n"               // Handled area start  (relative to start of function)
    469469        "       .uleb128 .TRYEND-.TRYSTART\n"                           // Handled area length
    470         "       .uleb128 .CATCH-__cfaehm__try_terminate\n"                              // Hanlder landing pad adress  (relative to start of function)
     470        "       .uleb128 .CATCH-__cfaabi_ehm__try_terminate\n"                          // Hanlder landing pad adress  (relative to start of function)
    471471        "       .uleb128 1\n"                                           // Action code, gcc seems to use always 0
    472472        ".LLSDACSECFA2:\n"                                              // BODY end
    473473        "       .text\n"                                                        // TABLE footer
    474         "       .size   __cfaehm__try_terminate, .-__cfaehm__try_terminate\n"
     474        "       .size   __cfaabi_ehm__try_terminate, .-__cfaabi_ehm__try_terminate\n"
    475475        "       .ident  \"GCC: (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901\"\n"
    476476//      "       .section        .note.GNU-stack,\"x\",@progbits\n"
  • src/libcfa/exception.h

    r389528b0 r35bae526  
    2121#endif
    2222
    23 struct __cfaehm__base_exception_t;
    24 typedef struct __cfaehm__base_exception_t exception;
    25 struct __cfaehm__base_exception_t_vtable {
    26         const struct __cfaehm__base_exception_t_vtable * parent;
     23struct __cfaabi_ehm__base_exception_t;
     24typedef struct __cfaabi_ehm__base_exception_t exception;
     25struct __cfaabi_ehm__base_exception_t_vtable {
     26        const struct __cfaabi_ehm__base_exception_t_vtable * parent;
    2727        size_t size;
    28         void (*copy)(struct __cfaehm__base_exception_t *this,
    29                      struct __cfaehm__base_exception_t * other);
    30         void (*free)(struct __cfaehm__base_exception_t *this);
    31         const char * (*msg)(struct __cfaehm__base_exception_t *this);
     28        void (*copy)(struct __cfaabi_ehm__base_exception_t *this,
     29                     struct __cfaabi_ehm__base_exception_t * other);
     30        void (*free)(struct __cfaabi_ehm__base_exception_t *this);
     31        const char * (*msg)(struct __cfaabi_ehm__base_exception_t *this);
    3232};
    33 struct __cfaehm__base_exception_t {
    34         struct __cfaehm__base_exception_t_vtable const * virtual_table;
     33struct __cfaabi_ehm__base_exception_t {
     34        struct __cfaabi_ehm__base_exception_t_vtable const * virtual_table;
    3535};
    36 extern struct __cfaehm__base_exception_t_vtable
    37         ___cfaehm__base_exception_t_vtable_instance;
     36extern struct __cfaabi_ehm__base_exception_t_vtable
     37        ___cfaabi_ehm__base_exception_t_vtable_instance;
    3838
    3939
    4040// Used in throw statement translation.
    41 void __cfaehm__throw_terminate(exception * except) __attribute__((noreturn));
    42 void __cfaehm__rethrow_terminate() __attribute__((noreturn));
    43 void __cfaehm__throw_resume(exception * except);
     41void __cfaabi_ehm__throw_terminate(exception * except) __attribute__((noreturn));
     42void __cfaabi_ehm__rethrow_terminate() __attribute__((noreturn));
     43void __cfaabi_ehm__throw_resume(exception * except);
    4444
    4545// Function catches termination exceptions.
    46 void __cfaehm__try_terminate(
     46void __cfaabi_ehm__try_terminate(
    4747    void (*try_block)(),
    4848    void (*catch_block)(int index, exception * except),
     
    5050
    5151// Clean-up the exception in catch blocks.
    52 void __cfaehm__cleanup_terminate(void * except);
     52void __cfaabi_ehm__cleanup_terminate(void * except);
    5353
    5454// Data structure creates a list of resume handlers.
    55 struct __cfaehm__try_resume_node {
    56     struct __cfaehm__try_resume_node * next;
     55struct __cfaabi_ehm__try_resume_node {
     56    struct __cfaabi_ehm__try_resume_node * next;
    5757    _Bool (*handler)(exception * except);
    5858};
    5959
    6060// These act as constructor and destructor for the resume node.
    61 void __cfaehm__try_resume_setup(
    62     struct __cfaehm__try_resume_node * node,
     61void __cfaabi_ehm__try_resume_setup(
     62    struct __cfaabi_ehm__try_resume_node * node,
    6363    _Bool (*handler)(exception * except));
    64 void __cfaehm__try_resume_cleanup(
    65     struct __cfaehm__try_resume_node * node);
     64void __cfaabi_ehm__try_resume_cleanup(
     65    struct __cfaabi_ehm__try_resume_node * node);
    6666
    6767// Check for a standard way to call fake deconstructors.
    68 struct __cfaehm__cleanup_hook {};
     68struct __cfaabi_ehm__cleanup_hook {};
    6969
    7070#ifdef __cforall
  • src/libcfa/interpose.c

    r389528b0 r35bae526  
    2424}
    2525
    26 #include "libhdr/libdebug.h"
     26#include "bits/debug.h"
    2727#include "libhdr/libtools.h"
    2828#include "startup.h"
     
    6969__typeof__( exit ) libc_exit __attribute__(( noreturn ));
    7070__typeof__( abort ) libc_abort __attribute__(( noreturn ));
    71 
    72 // #define INIT_REALRTN( x, ver ) libc_##x = (__typeof__(libc_##x))interpose_symbol( #x, ver )
    7371
    7472forall(dtype T)
     
    127125                        va_end( args );
    128126
    129                         __lib_debug_write( abort_text, len );
    130                         __lib_debug_write( "\n", 1 );
     127                        __cfaabi_dbg_bits_write( abort_text, len );
     128                        __cfaabi_dbg_bits_write( "\n", 1 );
    131129                }
    132130
    133131                len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid)
    134                 __lib_debug_write( abort_text, len );
     132                __cfaabi_dbg_bits_write( abort_text, len );
    135133
    136134
  • src/libcfa/libhdr.h

    r389528b0 r35bae526  
    1717
    1818#include "libhdr/libalign.h"
    19 #include "libhdr/libdebug.h"
    2019#include "libhdr/libtools.h"
    2120
  • src/libcfa/stdhdr/assert.h

    r389528b0 r35bae526  
    3030#endif
    3131
     32#if !defined(NDEBUG) && (defined(__CFA_DEBUG__) || defined(__CFA_VERIFY__))
     33        #define verify(x) assert(x)
     34        #define verifyf(x, ...) assertf(x, __VA_ARGS__)
     35#else
     36        #define verify(x)
     37        #define verifyf(x, ...)
     38#endif
     39
    3240#ifdef __cforall
    3341} // extern "C"
  • src/prelude/builtins.c

    r389528b0 r35bae526  
    1616// exception implementation
    1717
    18 typedef unsigned long long __cfaabi_exception_type_t;
     18typedef unsigned long long __cfaabi_abi_exception_type_t;
    1919
    2020#include "../libcfa/virtual.h"
     
    8080} // ?\?
    8181
    82 // FIXME (x \ (unsigned long int)y) relies on X ?\?(T, unsigned long) a function that is neither 
    83 // defined, nor passed as an assertion parameter. Without user-defined conversions, cannot specify 
    84 // X as a type that casts to double, yet it doesn't make sense to write functions with that type 
     82// FIXME (x \ (unsigned long int)y) relies on X ?\?(T, unsigned long) a function that is neither
     83// defined, nor passed as an assertion parameter. Without user-defined conversions, cannot specify
     84// X as a type that casts to double, yet it doesn't make sense to write functions with that type
    8585// signature where X is double.
    8686
  • src/tests/except-mac.h

    r389528b0 r35bae526  
    77
    88// The fully (perhaps overly) qualified name of the base exception type:
    9 #define BASE_EXCEPT __cfaehm__base_exception_t
     9#define BASE_EXCEPT __cfaabi_ehm__base_exception_t
    1010
    1111// Get the name of the vtable type and vtable instance for an exception type:
Note: See TracChangeset for help on using the changeset viewer.