6 #ifndef _PSP2_LIBDBG_H_
7 #define _PSP2_LIBDBG_H_
32 #ifndef SCE_DBG_COMPONENT
33 #define SCE_DBG_COMPONENT NULL
41 #ifndef SCE_DBG_BREAK_ON_ASSERT
42 #define SCE_DBG_BREAK_ON_ASSERT 1
51 #ifndef SCE_DBG_BREAK_ACTION
52 #define SCE_DBG_BREAK_ACTION asm volatile ("bkpt 0x0")
61 #define SCE_DBG_ASSERT(expression) \
63 if (!(expression)) { \
64 sceDbgAssertionHandler(__FILE__, __LINE__, 0, SCE_DBG_COMPONENT, "Assertion ("#expression") failed.\n"); \
65 if (SCE_DBG_BREAK_ON_ASSERT) \
66 SCE_DBG_BREAK_ACTION; \
75 #define SCE_DBG_ASSERT_MSG(expression, msg, ...) \
77 if (!(expression)) { \
78 sceDbgAssertionHandler(__FILE__, __LINE__, 0, SCE_DBG_COMPONENT, msg, ##__VA_ARGS__); \
79 if (SCE_DBG_BREAK_ON_ASSERT) \
80 SCE_DBG_BREAK_ACTION; \
89 #define SCE_DBG_LOG(logLevel, msg, ...) \
90 sceDbgLoggingHandler(__FILE__, __LINE__, logLevel, SCE_DBG_COMPONENT, msg, ##__VA_ARGS__)
95 #define SCE_DBG_LOG_TRACE(msg, ...) SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_TRACE, msg, ##__VA_ARGS__)
96 #define SCE_DBG_LOG_INFO(msg, ...) SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_INFO, msg, ##__VA_ARGS__)
97 #define SCE_DBG_LOG_DEBUG(msg, ...) SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)
98 #define SCE_DBG_LOG_WARNING(msg, ...) SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_WARNING, msg, ##__VA_ARGS__)
99 #define SCE_DBG_LOG_ERROR(msg, ...) SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_ERROR, msg, ##__VA_ARGS__)
101 #define SCE_DBG_ASSERT(expression)
102 #define SCE_DBG_ASSERT_MSG(expression, msg, ...)
103 #define SCE_DBG_LOG(msg, ...)
105 #define SCE_DBG_LOG_TRACE(msg, ...)
106 #define SCE_DBG_LOG_INFO(msg, ...)
107 #define SCE_DBG_LOG_DEBUG(msg, ...)
108 #define SCE_DBG_LOG_WARNING(msg, ...)
109 #define SCE_DBG_LOG_ERROR(msg, ...)
int sceDbgLoggingHandler(const char *file, int line, SceDbgLogLevel logLevel, const char *component, const char *msg,...)
Handler for logging in this library.
int sceDbgAssertionHandler(const char *file, int line, int unk, const char *component, const char *msg,...)
Handler for assertion logging in this library.
void sceDbgSetBreakOnWarningState(SceBool breakOnWarning)
Set whether or not to enter a breakpoint upon logging a warning.
void sceDbgSetMinimumLogLevel(SceDbgLogLevel level)
Set the minimum logging level.
void sceDbgSetBreakOnErrorState(SceBool breakOnError)
Set whether or not to enter a breakpoint upon logging an error.
SceDbgLogLevel
Logging level for sceDbgLoggingHandler.
Definition: libdbg.h:18
@ SCE_DBG_LOG_LEVEL_DEBUG
Definition: libdbg.h:20
@ SCE_DBG_LOG_LEVEL_TRACE
Definition: libdbg.h:19
@ SCE_DBG_NUM_LOG_LEVELS
Definition: libdbg.h:24
@ SCE_DBG_LOG_LEVEL_WARNING
Definition: libdbg.h:22
@ SCE_DBG_LOG_LEVEL_ERROR
Definition: libdbg.h:23
@ SCE_DBG_LOG_LEVEL_INFO
Definition: libdbg.h:21
int SceBool
Definition: types.h:59