Go to the source code of this file.
|
#define | UNUSED __attribute__ ((unused)) |
| GCC lets us add "attributes" to functions, function parameters, etc. More...
|
|
#define | NO_RETURN __attribute__ ((noreturn)) |
|
#define | NO_INLINE __attribute__ ((noinline)) |
|
#define | PRINTF_FORMAT(FMT, FIRST) __attribute__ ((format (printf, FMT, FIRST))) |
|
#define | PANIC(...) debug_panic (__FILE__, __LINE__, __func__, __VA_ARGS__) |
| Halts the OS, printing the source file name, line number, and function name, plus a user-specific message. More...
|
|
#define | ASSERT(CONDITION) |
| This is outside the header guard so that debug.h may be included multiple times with different settings of NDEBUG. More...
|
|
#define | NOT_REACHED() PANIC ("executed an unreachable statement"); |
| lib/debug.h More...
|
|
◆ ASSERT
#define ASSERT |
( |
|
CONDITION | ) |
|
Value: if (CONDITION) { } else { \
PANIC ("assertion `%s' failed.", #CONDITION); \
}
This is outside the header guard so that debug.h may be included multiple times with different settings of NDEBUG.
Definition at line 31 of file debug.h.
◆ NO_INLINE
◆ NO_RETURN
◆ NOT_REACHED
#define NOT_REACHED |
( |
| ) |
PANIC ("executed an unreachable statement"); |
◆ PANIC
#define PANIC |
( |
|
... | ) |
debug_panic (__FILE__, __LINE__, __func__, __VA_ARGS__) |
Halts the OS, printing the source file name, line number, and function name, plus a user-specific message.
Definition at line 14 of file debug.h.
◆ PRINTF_FORMAT
◆ UNUSED
GCC lets us add "attributes" to functions, function parameters, etc.
to indicate their properties. See the GCC manual for details.
Definition at line 7 of file debug.h.
◆ debug_backtrace()
void debug_backtrace |
( |
void |
| ) |
|
Prints the call stack, that is, a list of addresses, one in each of the functions we are nested within.
gdb or addr2line may be applied to kernel.o to translate these into file names, line numbers, and function names.
Definition at line 13 of file debug.c.
References NULL, and printf().
Referenced by debug_panic().
◆ debug_backtrace_all()
void debug_backtrace_all |
( |
void |
| ) |
|
◆ debug_panic()
void debug_panic |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const char * |
function, |
|
|
const char * |
message, |
|
|
|
... |
|
) |
| |
◆ NO_RETURN