Line 37... |
Line 37... |
|
|
#ifndef __ORSIM_DBG_USE_FUNC
|
#ifndef __ORSIM_DBG_USE_FUNC
|
#define __ORSIM_DBG_USE_FUNC __FUNCTION__
|
#define __ORSIM_DBG_USE_FUNC __FUNCTION__
|
#endif
|
#endif
|
|
|
#define __ORSIM_DPRINTF(dbcl, dbch) \
|
|
do { const char * const __dbch = dbch; \
|
|
const enum __ORSIM_DEBUG_CLASS __dbcl = __ORSIM_DBCL_##dbcl; \
|
|
__ORSIM_DEBUG_LOG
|
|
|
|
#define __ORSIM_DEBUG_LOG(args...) \
|
|
orsim_dbg_log(__dbcl, __dbch, __ORSIM_DBG_USE_FUNC, args); } while(0)
|
|
|
|
#define __ORSIM_GET_DEBUGGING_TRACE(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_TRACE))
|
#define __ORSIM_GET_DEBUGGING_TRACE(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_TRACE))
|
#define __ORSIM_GET_DEBUGGING_WARN(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_WARN))
|
#define __ORSIM_GET_DEBUGGING_WARN(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_WARN))
|
#define __ORSIM_GET_DEBUGGING_FIXME(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_FIXME))
|
#define __ORSIM_GET_DEBUGGING_FIXME(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_FIXME))
|
#define __ORSIM_GET_DEBUGGING_ERR(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_ERR))
|
#define __ORSIM_GET_DEBUGGING_ERR(dbch) ((dbch)[0] & (1 << __ORSIM_DBCL_ERR))
|
|
|
#define __ORSIM_GET_DEBUGGING(dbcl,dbch) __ORSIM_GET_DEBUGGING##dbcl(dbch)
|
#define __ORSIM_GET_DEBUGGING(dbcl,dbch) __ORSIM_GET_DEBUGGING##dbcl(dbch)
|
|
|
#define TRACE_(ch) __ORSIM_DPRINTF(TRACE, __orsim_dbch_##ch)
|
#define __ORSIM_DPRINTF(dbcl, dbch) \
|
#define FIXME_(ch) __ORSIM_DPRINTF(FIXME, __orsim_dbch_##ch)
|
do { if(__ORSIM_GET_DEBUGGING(dbcl,(dbch))) { \
|
#define WARN_(ch) __ORSIM_DPRINTF(WARN, __orsim_dbch_##ch)
|
const char * const __dbch = dbch; \
|
#define ERR_(ch) __ORSIM_DPRINTF(ERR, __orsim_dbch_##ch)
|
const enum __ORSIM_DEBUG_CLASS __dbcl = __ORSIM_DBCL##dbcl; \
|
|
__ORSIM_DEBUG_LOG
|
#define TRACE __ORSIM_DPRINTF(TRACE, __orsim_dbch___default)
|
|
#define FIXME __ORSIM_DPRINTF(FIXME, __orsim_dbch___default)
|
#define __ORSIM_DEBUG_LOG(args...) \
|
#define WARN __ORSIM_DPRINTF(WARN, __orsim_dbch___default)
|
orsim_dbg_log(__dbcl, __dbch, __ORSIM_DBG_USE_FUNC, args); } } while(0)
|
#define ERR __ORSIM_DPRINTF(ERR, __orsim_dbch___default)
|
|
|
#define TRACE_(ch) __ORSIM_DPRINTF(_TRACE, __orsim_dbch_##ch)
|
|
#define FIXME_(ch) __ORSIM_DPRINTF(_FIXME, __orsim_dbch_##ch)
|
|
#define WARN_(ch) __ORSIM_DPRINTF(_WARN, __orsim_dbch_##ch)
|
|
#define ERR_(ch) __ORSIM_DPRINTF(_ERR, __orsim_dbch_##ch)
|
|
|
|
#define TRACE __ORSIM_DPRINTF(_TRACE, __orsim_dbch___default)
|
|
#define FIXME __ORSIM_DPRINTF(_FIXME, __orsim_dbch___default)
|
|
#define WARN __ORSIM_DPRINTF(_WARN, __orsim_dbch___default)
|
|
#define ERR __ORSIM_DPRINTF(_ERR, __orsim_dbch___default)
|
|
|
#define TRACE_ON(ch) __ORSIM_GET_DEBUGGING(_TRACE,__orsim_dbch_##ch)
|
#define TRACE_ON(ch) __ORSIM_GET_DEBUGGING(_TRACE,__orsim_dbch_##ch)
|
#define WARN_ON(ch) __ORSIM_GET_DEBUGGING(_WARN,__orsim_dbch_##ch)
|
#define WARN_ON(ch) __ORSIM_GET_DEBUGGING(_WARN,__orsim_dbch_##ch)
|
#define FIXME_ON(ch) __ORSIM_GET_DEBUGGING(_FIXME,__orsim_dbch_##ch)
|
#define FIXME_ON(ch) __ORSIM_GET_DEBUGGING(_FIXME,__orsim_dbch_##ch)
|
#define ERR_ON(ch) __ORSIM_GET_DEBUGGING(_ERR,__orsim_dbch_##ch)
|
#define ERR_ON(ch) __ORSIM_GET_DEBUGGING(_ERR,__orsim_dbch_##ch)
|