static void dump_ctx_printf(struct dump_ctx *ctx, const char *format, ...) { va_list ap; (void)ctx; va_start(ap, format); _debug_vprintf(format, ap); va_end(ap); }
static INLINE void exa_debug_printf(const char *format, ...) { #if 0 va_list ap; va_start(ap, format); _debug_vprintf(format, ap); va_end(ap); #else (void) format; /* silence warning */ #endif }
/** Internal debug function. Should be available to final users. */ void pp_debug(const char *fmt, ...) { va_list ap; if (!debug_get_bool_option("PP_DEBUG", FALSE)) return; va_start(ap, fmt); _debug_vprintf(fmt, ap); va_end(ap); }
void _nine_debug_printf( unsigned long flag, const char *func, const char *fmt, ... ) { static boolean first = TRUE; static unsigned long dbg_flags = DBG_ERROR | DBG_WARN; unsigned long tid = 0; if (first) { first = FALSE; dbg_flags |= debug_get_flags_option("NINE_DEBUG", nine_debug_flags, 0); } #if defined(HAVE_PTHREAD) # if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \ (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) if (dbg_flags & DBG_TID) tid = pthread_self(); # endif #endif if (dbg_flags & flag) { const char *f = func ? strrchr(func, '_') : NULL; va_list ap; /* inside a class this will print nine:tid:classinlowercase:func: while * outside a class (rarely used) it will just print nine:tid:func * the reason for lower case is simply to match the filenames, as it * will also strip off the "Nine" */ if (f && strncmp(func, "Nine", 4) == 0) { char klass[96]; /* no class name is this long */ char *ptr = klass; for (func += 4; func != f; ++func) { *ptr++ = tolower(*func); } *ptr = '\0'; if (tid) _debug_printf("nine:0x%08lx:%s:%s: ", tid, klass, ++f); else _debug_printf("nine:%s:%s: ", klass, ++f); } else if (func) { if (tid) _debug_printf("nine:0x%08lx:%s ", tid, func); else _debug_printf("nine:%s ", func); } va_start(ap, fmt); _debug_vprintf(fmt, ap); va_end(ap); } }
static void report_warning( struct sanity_check_ctx *ctx, const char *format, ... ) { va_list args; debug_printf( "Warning: " ); va_start( args, format ); _debug_vprintf( format, args ); va_end( args ); debug_printf( "\n" ); ctx->warnings++; }
static void report_error( struct sanity_check_ctx *ctx, const char *format, ... ) { va_list args; debug_printf( "Error : " ); va_start( args, format ); _debug_vprintf( format, args ); va_end( args ); debug_printf( "\n" ); ctx->errors++; }