mkernel 0.0.2
Micro-kernel framework, everything as a module
|
Debugging macros. More...
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | ASSERT(condition) |
Assertion check macro. More... | |
#define | DBG_TRACE _trace(__FILE__,__LINE__, __DATE__, __TIME__, __func__) |
Checkpoint on stderr. More... | |
#define | DBG_MSG(msg) _trace_msg(__FILE__,__LINE__, __DATE__, __TIME__, __func__,msg) |
Checkpoint on stderr with a static message. More... | |
#define | DBG_ITRACE(inst) |
Instruction checkpint. More... | |
#define | DBG_PRINTF(p_Format, ...) _trace_dynmsg(__FILE__,__LINE__, __DATE__, __TIME__, __func__, p_Format, __VA_ARGS__) |
Log a timestamped debugging message on stderr. More... | |
Functions | |
void | _trace (const char *p_File, const unsigned int p_Line, const char *p_CompilDate, const char *p_CompilTime, const char *p_Function) |
Print a debug trace (checkpoint) More... | |
void | _trace_msg (const char *p_File, const unsigned int p_Line, const char *p_CompilDate, const char *p_CompilTime, const char *p_Function, const char *p_Message) |
Print a debug trace (checkpoint) with a static message. More... | |
void | _trace_dynmsg (const char *p_File, const unsigned int p_Line, const char *p_CompilDate, const char *p_CompilTime, const char *p_Function, const char *p_Format,...) |
Print a debug trace (checkpoint) with a formatted message. More... | |
Debugging macros.
Originally inspired by "L'art du code", Steve Maguire, Microsoft Press
Definition in file assert.h.
#define ASSERT | ( | condition | ) |
Assertion check macro.
[in] | condition | to check |
If NDEBUG is set, does nothing. If NDEBUG is not defined, checks that the condition is true, otherwise stop the process
#define DBG_ITRACE | ( | inst | ) |
Instruction checkpint.
Writes a checkpoint trace with timestamp, filename, function name and line number when executing an instruction.
#define DBG_MSG | ( | msg | ) | _trace_msg(__FILE__,__LINE__, __DATE__, __TIME__, __func__,msg) |
#define DBG_PRINTF | ( | p_Format, | |
... | |||
) | _trace_dynmsg(__FILE__,__LINE__, __DATE__, __TIME__, __func__, p_Format, __VA_ARGS__) |
#define DBG_TRACE _trace(__FILE__,__LINE__, __DATE__, __TIME__, __func__) |
void _trace | ( | const char * | p_File, |
const unsigned int | p_Line, | ||
const char * | p_CompilDate, | ||
const char * | p_CompilTime, | ||
const char * | p_Function | ||
) |
Print a debug trace (checkpoint)
[in] | p_File | Source file |
[in] | p_Line | Source line in the source file |
[in] | p_CompilDate | Compilation date |
[in] | p_CompilTime | Compilation time |
[in] | p_Function | Function name in the source file |
Outputs on stderr a timestamp, with the filename, the sourceline, the compilation date and time, the function name.
void _trace_dynmsg | ( | const char * | p_File, |
const unsigned int | p_Line, | ||
const char * | p_CompilDate, | ||
const char * | p_CompilTime, | ||
const char * | p_Function, | ||
const char * | p_Format, | ||
... | |||
) |
Print a debug trace (checkpoint) with a formatted message.
[in] | p_File | Source file |
[in] | p_Line | Source line in the source file |
[in] | p_CompilDate | Compilation date |
[in] | p_CompilTime | Compilation time |
[in] | p_Function | Function name in the source file |
[in] | p_Format | format string |
[in] | ... | Formatted string parameters |
Outputs on stderr a timestamp, with the filename, the sourceline, the compilation date and time, the function name and a formatted message.
void _trace_msg | ( | const char * | p_File, |
const unsigned int | p_Line, | ||
const char * | p_CompilDate, | ||
const char * | p_CompilTime, | ||
const char * | p_Function, | ||
const char * | p_Message | ||
) |
Print a debug trace (checkpoint) with a static message.
[in] | p_File | Source file |
[in] | p_Line | Source line in the source file |
[in] | p_CompilDate | Compilation date |
[in] | p_CompilTime | Compilation time |
[in] | p_Function | Function name in the source file |
[in] | p_Message | Static message |
Outputs on stderr a timestamp, with the filename, the sourceline, the compilation date and time, the function name and a static message.