Changeset 36982fc for src/libcfa/libhdr


Ignore:
Timestamp:
Nov 29, 2017, 2:50:33 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
875a72f
Parents:
8a0a64d9
Message:

Renamed internal stuff to cfaabi_...

Location:
src/libcfa/libhdr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/libhdr/libdebug.c

    r8a0a64d9 r36982fc  
    2828extern "C" {
    2929
    30         void __lib_debug_write( const char *in_buffer, int len ) {
     30        void __cfaabi_dbg_bits_write( const char *in_buffer, int len ) {
    3131                // ensure all data is written
    3232                for ( int count = 0, retcode; count < len; count += retcode ) {
     
    4444        }
    4545
    46         void __lib_debug_acquire() __attribute__((__weak__)) {}
    47         void __lib_debug_release() __attribute__((__weak__)) {}
     46        void __cfaabi_dbg_bits_acquire() __attribute__((__weak__)) {}
     47        void __cfaabi_dbg_bits_release() __attribute__((__weak__)) {}
    4848
    49         void __lib_debug_print_safe  ( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) )) {
     49        void __cfaabi_dbg_bits_print_safe  ( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) )) {
    5050                va_list args;
    5151
    5252                va_start( args, fmt );
    53                 __lib_debug_acquire();
     53                __cfaabi_dbg_bits_acquire();
    5454
    5555                int len = vsnprintf( buffer, buffer_size, fmt, args );
    56                 __lib_debug_write( buffer, len );
     56                __cfaabi_dbg_bits_write( buffer, len );
    5757
    58                 __lib_debug_release();
     58                __cfaabi_dbg_bits_release();
    5959                va_end( args );
    6060        }
    6161
    62         void __lib_debug_print_nolock( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) )) {
     62        void __cfaabi_dbg_bits_print_nolock( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) )) {
    6363                va_list args;
    6464
     
    6666
    6767                int len = vsnprintf( buffer, buffer_size, fmt, args );
    68                 __lib_debug_write( buffer, len );
     68                __cfaabi_dbg_bits_write( buffer, len );
    6969
    7070                va_end( args );
    7171        }
    7272
    73         void __lib_debug_print_vararg( const char fmt[], va_list args ) {
     73        void __cfaabi_dbg_bits_print_vararg( const char fmt[], va_list args ) {
    7474                int len = vsnprintf( buffer, buffer_size, fmt, args );
    75                 __lib_debug_write( buffer, len );
     75                __cfaabi_dbg_bits_write( buffer, len );
    7676        }
    7777
    78         void __lib_debug_print_buffer( char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format (printf, 3, 4) )) {
     78        void __cfaabi_dbg_bits_print_buffer( char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format (printf, 3, 4) )) {
    7979                va_list args;
    8080
     
    8282
    8383                int len = vsnprintf( in_buffer, in_buffer_size, fmt, args );
    84                 __lib_debug_write( in_buffer, len );
     84                __cfaabi_dbg_bits_write( in_buffer, len );
    8585
    8686                va_end( args );
  • src/libcfa/libhdr/libdebug.h

    r8a0a64d9 r36982fc  
    1717
    1818#ifdef __CFA_DEBUG__
    19         #define LIB_DEBUG_DO(...) __VA_ARGS__
    20         #define LIB_NO_DEBUG_DO(...)
    21         #define DEBUG_CTX __PRETTY_FUNCTION__
    22         #define DEBUG_CTX2 , __PRETTY_FUNCTION__
    23         #define DEBUG_CTX_PARAM const char * caller
    24         #define DEBUG_CTX_PARAM2 , const char * caller
     19        #define __cfaabi_dbg_debug_do(...) __VA_ARGS__
     20        #define __cfaabi_dbg_no_debug_do(...)
     21        #define __cfaabi_dbg_ctx __PRETTY_FUNCTION__
     22        #define __cfaabi_dbg_ctx2 , __PRETTY_FUNCTION__
     23        #define __cfaabi_dbg_ctx_param const char * caller
     24        #define __cfaabi_dbg_ctx_param2 , const char * caller
    2525#else
    26         #define LIB_DEBUG_DO(...)
    27         #define LIB_NO_DEBUG_DO(...) __VA_ARGS__
    28         #define DEBUG_CTX
    29         #define DEBUG_CTX2
    30         #define DEBUG_CTX_PARAM
    31         #define DEBUG_CTX_PARAM2
     26        #define __cfaabi_dbg_debug_do(...)
     27        #define __cfaabi_dbg_no_debug_do(...) __VA_ARGS__
     28        #define __cfaabi_dbg_ctx
     29        #define __cfaabi_dbg_ctx2
     30        #define __cfaabi_dbg_ctx_param
     31        #define __cfaabi_dbg_ctx_param2
    3232#endif
    3333
    34 #if !defined(NDEBUG) && (defined(__CFA_DEBUG__) || defined(__CFA_VERIFY__))
    35         #define verify(x) assert(x)
    36         #define verifyf(x, ...) assertf(x, __VA_ARGS__)
    37 #else
    38         #define verify(x)
    39         #define verifyf(x, ...)
    40 #endif
    41 
     34__cfaabi::ehm
     35__cfaabi::dbg
     36__cfaabi::rt
     37__cfaabi::mem
    4238
    4339#ifdef __cforall
     
    4743        #include <stdio.h>
    4844
    49       extern void __lib_debug_write( const char *buffer, int len );
    50       extern void __lib_debug_acquire();
    51       extern void __lib_debug_release();
    52       extern void __lib_debug_print_safe  ( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) ));
    53       extern void __lib_debug_print_nolock( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) ));
    54       extern void __lib_debug_print_vararg( const char fmt[], va_list arg );
    55       extern void __lib_debug_print_buffer( char buffer[], int buffer_size, const char fmt[], ... ) __attribute__(( format (printf, 3, 4) ));
     45      extern void __cfaabi_dbg_bits_write( const char *buffer, int len );
     46      extern void __cfaabi_dbg_bits_acquire();
     47      extern void __cfaabi_dbg_bits_release();
     48      extern void __cfaabi_dbg_bits_print_safe  ( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) ));
     49      extern void __cfaabi_dbg_bits_print_nolock( const char fmt[], ... ) __attribute__(( format (printf, 1, 2) ));
     50      extern void __cfaabi_dbg_bits_print_vararg( const char fmt[], va_list arg );
     51      extern void __cfaabi_dbg_bits_print_buffer( char buffer[], int buffer_size, const char fmt[], ... ) __attribute__(( format (printf, 3, 4) ));
    5652#ifdef __cforall
    5753}
     
    5955
    6056#ifdef __CFA_DEBUG_PRINT__
    61         #define LIB_DEBUG_WRITE( buffer, len )         __lib_debug_write( buffer, len )
    62         #define LIB_DEBUG_ACQUIRE()                    __lib_debug_acquire()
    63         #define LIB_DEBUG_RELEASE()                    __lib_debug_release()
    64         #define LIB_DEBUG_PRINT_SAFE(...)              __lib_debug_print_safe   (__VA_ARGS__)
    65         #define LIB_DEBUG_PRINT_NOLOCK(...)            __lib_debug_print_nolock (__VA_ARGS__)
    66         #define LIB_DEBUG_PRINT_BUFFER(...)            __lib_debug_print_buffer (__VA_ARGS__)
    67         #define LIB_DEBUG_PRINT_BUFFER_DECL(...)       char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );
    68         #define LIB_DEBUG_PRINT_BUFFER_LOCAL(...)      __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __lib_debug_write( __dbg_text, __dbg_len );
     57        #define __cfaabi_dbg_write( buffer, len )         __cfaabi_dbg_bits_write( buffer, len )
     58        #define __cfaabi_dbg_acquire()                    __cfaabi_dbg_bits_acquire()
     59        #define __cfaabi_dbg_release()                    __cfaabi_dbg_bits_release()
     60        #define __cfaabi_dbg_print_safe(...)              __cfaabi_dbg_bits_print_safe   (__VA_ARGS__)
     61        #define __cfaabi_dbg_print_nolock(...)            __cfaabi_dbg_bits_print_nolock (__VA_ARGS__)
     62        #define __cfaabi_dbg_print_buffer(...)            __cfaabi_dbg_bits_print_buffer (__VA_ARGS__)
     63        #define __cfaabi_dbg_print_buffer_decl(...)       char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_dbg_bits_write( __dbg_text, __dbg_len );
     64        #define __cfaabi_dbg_print_buffer_local(...)      __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_dbg_bits_write( __dbg_text, __dbg_len );
    6965#else
    70         #define LIB_DEBUG_WRITE(...)               ((void)0)
    71         #define LIB_DEBUG_ACQUIRE()                ((void)0)
    72         #define LIB_DEBUG_RELEASE()                ((void)0)
    73         #define LIB_DEBUG_PRINT_SAFE(...)          ((void)0)
    74         #define LIB_DEBUG_PRINT_NOLOCK(...)        ((void)0)
    75         #define LIB_DEBUG_PRINT_BUFFER(...)        ((void)0)
    76         #define LIB_DEBUG_PRINT_BUFFER_DECL(...)   ((void)0)
    77         #define LIB_DEBUG_PRINT_BUFFER_LOCAL(...)  ((void)0)
     66        #define __cfaabi_dbg_write(...)               ((void)0)
     67        #define __cfaabi_dbg_acquire()                ((void)0)
     68        #define __cfaabi_dbg_release()                ((void)0)
     69        #define __cfaabi_dbg_print_safe(...)          ((void)0)
     70        #define __cfaabi_dbg_print_nolock(...)        ((void)0)
     71        #define __cfaabi_dbg_print_buffer(...)        ((void)0)
     72        #define __cfaabi_dbg_print_buffer_decl(...)   ((void)0)
     73        #define __cfaabi_dbg_print_buffer_local(...)  ((void)0)
    7874#endif
    7975
Note: See TracChangeset for help on using the changeset viewer.