vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceLibDbg_stub


Load the required module:

int sceSysmoduleLoadModule(SceSysmoduleModuleId id)
Load a module.
@ SCE_SYSMODULE_DBG
DBG module.
Definition: sysmodule.h:35



Functions

int sceDbgAssertionHandler (const char *file, int line, int unk, const char *component, const char *msg,...)
 Handler for assertion logging in this library. More...
 
int sceDbgLoggingHandler (const char *file, int line, SceDbgLogLevel logLevel, const char *component, const char *msg,...)
 Handler for logging in this library. More...
 
void sceDbgSetBreakOnErrorState (SceBool breakOnError)
 Set whether or not to enter a breakpoint upon logging an error. More...
 
void sceDbgSetBreakOnWarningState (SceBool breakOnWarning)
 Set whether or not to enter a breakpoint upon logging a warning. More...
 
void sceDbgSetMinimumLogLevel (SceDbgLogLevel level)
 Set the minimum logging level. More...
 

Macros

#define SCE_DBG_COMPONENT   NULL
 Macro for the component SceLibDbg is being called within. More...
 
#define SCE_DBG_BREAK_ON_ASSERT   1
 Set whether or not to break/stop when an assertion fails. More...
 
#define SCE_DBG_BREAK_ACTION   asm volatile ("bkpt 0x0")
 Set the break/stop action when an assertion fails. More...
 
#define SCE_DBG_ASSERT(expression)
 Assertion macro. More...
 
#define SCE_DBG_ASSERT_MSG(expression, msg, ...)
 Assertion macro with custom msg. More...
 
#define SCE_DBG_LOG(logLevel, msg, ...)   sceDbgLoggingHandler(__FILE__, __LINE__, logLevel, SCE_DBG_COMPONENT, msg, ##__VA_ARGS__)
 Logging macro. More...
 
#define SCE_DBG_LOG_TRACE(msg, ...)   SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_TRACE, msg, ##__VA_ARGS__)
 Logging macros for individual log levels. More...
 
#define SCE_DBG_LOG_INFO(msg, ...)   SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_INFO, msg, ##__VA_ARGS__)
 
#define SCE_DBG_LOG_DEBUG(msg, ...)   SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)
 
#define SCE_DBG_LOG_WARNING(msg, ...)   SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_WARNING, msg, ##__VA_ARGS__)
 
#define SCE_DBG_LOG_ERROR(msg, ...)   SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_ERROR, msg, ##__VA_ARGS__)
 

Macro Definition Documentation

◆ SCE_DBG_COMPONENT

#define SCE_DBG_COMPONENT   NULL

Macro for the component SceLibDbg is being called within.

If undefined, NULL will be passed.

◆ SCE_DBG_BREAK_ON_ASSERT

#define SCE_DBG_BREAK_ON_ASSERT   1

Set whether or not to break/stop when an assertion fails.

Enabled by default.

◆ SCE_DBG_BREAK_ACTION

#define SCE_DBG_BREAK_ACTION   asm volatile ("bkpt 0x0")

Set the break/stop action when an assertion fails.

Set to a breakpoint by default. abort() is an example of a suitable break action.

◆ SCE_DBG_ASSERT

#define SCE_DBG_ASSERT (   expression)
Value:
do { \
if (!(expression)) { \
sceDbgAssertionHandler(__FILE__, __LINE__, 0, SCE_DBG_COMPONENT, "Assertion ("#expression") failed.\n"); \
SCE_DBG_BREAK_ACTION; \
} \
} while (0)
#define SCE_DBG_COMPONENT
Macro for the component SceLibDbg is being called within.
Definition: libdbg.h:33
#define SCE_DBG_BREAK_ON_ASSERT
Set whether or not to break/stop when an assertion fails.
Definition: libdbg.h:42

Assertion macro.

Parameters
[in]expression- The expression to be tested.

◆ SCE_DBG_ASSERT_MSG

#define SCE_DBG_ASSERT_MSG (   expression,
  msg,
  ... 
)
Value:
do { \
if (!(expression)) { \
sceDbgAssertionHandler(__FILE__, __LINE__, 0, SCE_DBG_COMPONENT, msg, ##__VA_ARGS__); \
SCE_DBG_BREAK_ACTION; \
} \
} while (0)

Assertion macro with custom msg.

Parameters
[in]expression- The expression to be tested.
[in]msg- printf format string message.

◆ SCE_DBG_LOG

#define SCE_DBG_LOG (   logLevel,
  msg,
  ... 
)    sceDbgLoggingHandler(__FILE__, __LINE__, logLevel, SCE_DBG_COMPONENT, msg, ##__VA_ARGS__)

Logging macro.

Parameters
[in]logLevel- One of SceDbgLogLevel.
[in]msg- printf formatted message.

◆ SCE_DBG_LOG_TRACE

#define SCE_DBG_LOG_TRACE (   msg,
  ... 
)    SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_TRACE, msg, ##__VA_ARGS__)

Logging macros for individual log levels.

◆ SCE_DBG_LOG_INFO

#define SCE_DBG_LOG_INFO (   msg,
  ... 
)    SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_INFO, msg, ##__VA_ARGS__)

◆ SCE_DBG_LOG_DEBUG

#define SCE_DBG_LOG_DEBUG (   msg,
  ... 
)    SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_DEBUG, msg, ##__VA_ARGS__)

◆ SCE_DBG_LOG_WARNING

#define SCE_DBG_LOG_WARNING (   msg,
  ... 
)    SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_WARNING, msg, ##__VA_ARGS__)

◆ SCE_DBG_LOG_ERROR

#define SCE_DBG_LOG_ERROR (   msg,
  ... 
)    SCE_DBG_LOG(SCE_DBG_LOG_LEVEL_ERROR, msg, ##__VA_ARGS__)

Enumeration Type Documentation

◆ SceDbgLogLevel

Logging level for sceDbgLoggingHandler.

Enumerator
SCE_DBG_LOG_LEVEL_TRACE 
SCE_DBG_LOG_LEVEL_DEBUG 
SCE_DBG_LOG_LEVEL_INFO 
SCE_DBG_LOG_LEVEL_WARNING 
SCE_DBG_LOG_LEVEL_ERROR 
SCE_DBG_NUM_LOG_LEVELS 

Function Documentation

◆ sceDbgAssertionHandler()

int sceDbgAssertionHandler ( const char *  file,
int  line,
int  unk,
const char *  component,
const char *  msg,
  ... 
)

Handler for assertion logging in this library.

The complete formatted output must not exceed 511 characters, so it is advised your message does not exceed ~256 characters. The output will be truncated if it does exceed 511 characters.

Parameters
[in]file- Name of the file where the call was made.
[in]line- Line number where the call was made.
[in]unk- Unknown, never used internally.
[in]component- Name of the component where the call was made. Optional field.
[in]msg- printf formatted message.
Returns
Will return the unk parameter.

◆ sceDbgLoggingHandler()

int sceDbgLoggingHandler ( const char *  file,
int  line,
SceDbgLogLevel  logLevel,
const char *  component,
const char *  msg,
  ... 
)

Handler for logging in this library.

The complete formatted output must not exceed 511 characters, so it is advised that your message does not exceed ~300 characters. The output will be truncated if it does exceed 511 characters. A line break is automatically appended.

Parameters
[in]file- Name of the file where the call was made.
[in]line- Line number where the call was made.
[in]logLevel- One of SceDbgLogLevel.
[in]component- Name of the component where the call was made. Optional field.
[in]msg- printf formatted message.
Returns
0 on success, <0 on truncation of message.

◆ sceDbgSetBreakOnErrorState()

void sceDbgSetBreakOnErrorState ( SceBool  breakOnError)

Set whether or not to enter a breakpoint upon logging an error.

Disabled by default.

Parameters
[in]breakOnError- Enter the breakpoint?

◆ sceDbgSetBreakOnWarningState()

void sceDbgSetBreakOnWarningState ( SceBool  breakOnWarning)

Set whether or not to enter a breakpoint upon logging a warning.

Disabled by default.

Parameters
[in]breakOnWarning- Enter the breakpoint?

◆ sceDbgSetMinimumLogLevel()

void sceDbgSetMinimumLogLevel ( SceDbgLogLevel  level)

Set the minimum logging level.

Any attempts to log at a level lower than this will not be outputted.