DDraceNetwork Docs
Debug

Macros

#define dbg_assert(test, fmt, ...)
 

Functions

void dbg_assert_imp (const char *filename, int line, const char *fmt,...)
 
bool dbg_assert_has_failed ()
 
void dbg_break ()
 
void dbg_msg (const char *sys, const char *fmt,...)
 

Detailed Description

Utilities for debugging.

Macro Definition Documentation

◆ dbg_assert

#define dbg_assert (   test,
  fmt,
  ... 
)
Value:
do \
{ \
if(!(test)) \
{ \
dbg_assert_imp(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
} \
} while(false)

Breaks into the debugger based on a test.

Parameters
testResult of the test.
msgMessage that should be printed if the test fails.
Remarks
Also works in release mode.
See also
dbg_break

Function Documentation

◆ dbg_assert_has_failed()

bool dbg_assert_has_failed ( )

Checks whether the program is currently shutting down due to a failed assert.

Returns
indication whether the program is currently shutting down due to a failed assert.

◆ dbg_assert_imp()

void dbg_assert_imp ( const char *  filename,
int  line,
const char *  fmt,
  ... 
)

Use dbg_assert instead!

◆ dbg_break()

void dbg_break ( )

Breaks into the debugger.

Remarks
Also works in release mode.
See also
dbg_assert

◆ dbg_msg()

void dbg_msg ( const char *  sys,
const char *  fmt,
  ... 
)

Prints a debug message.

Parameters
sysA string that describes what system the message belongs to.
fmtA printf styled format string.
Remarks
Also works in release mode.
See also
dbg_assert