Minetest  5.4.0
debug.h File Reference
#include <iostream>
#include <exception>
#include <cassert>
#include "gettime.h"
#include "log.h"
+ Include dependency graph for debug.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NORETURN   __attribute__ ((__noreturn__))
 
#define FUNCTION_NAME   __PRETTY_FUNCTION__
 
#define CATCH_UNHANDLED_EXCEPTIONS   0
 
#define FATAL_ERROR(msg)    fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME)
 
#define FATAL_ERROR_IF(expr, msg)
 
#define SANITY_CHECK(expr)
 
#define sanity_check(expr)   SANITY_CHECK(expr)
 
#define BEGIN_DEBUG_EXCEPTION_HANDLER
 
#define END_DEBUG_EXCEPTION_HANDLER
 

Functions

NORETURN void fatal_error_fn (const char *msg, const char *file, unsigned int line, const char *function)
 
NORETURN void sanity_check_fn (const char *assertion, const char *file, unsigned int line, const char *function)
 
void debug_set_exception_handler ()
 

Macro Definition Documentation

◆ BEGIN_DEBUG_EXCEPTION_HANDLER

#define BEGIN_DEBUG_EXCEPTION_HANDLER

◆ CATCH_UNHANDLED_EXCEPTIONS

#define CATCH_UNHANDLED_EXCEPTIONS   0

◆ END_DEBUG_EXCEPTION_HANDLER

#define END_DEBUG_EXCEPTION_HANDLER

◆ FATAL_ERROR

#define FATAL_ERROR (   msg)     fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME)

◆ FATAL_ERROR_IF

#define FATAL_ERROR_IF (   expr,
  msg 
)
Value:
((expr) \
? fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME) \
: (void)(0))
#define FUNCTION_NAME
Definition: debug.h:40
NORETURN void fatal_error_fn(const char *msg, const char *file, unsigned int line, const char *function)
Definition: debug.cpp:62

◆ FUNCTION_NAME

#define FUNCTION_NAME   __PRETTY_FUNCTION__

◆ NORETURN

#define NORETURN   __attribute__ ((__noreturn__))

◆ SANITY_CHECK

#define SANITY_CHECK (   expr)
Value:
((expr) \
? (void)(0) \
: sanity_check_fn(#expr, __FILE__, __LINE__, FUNCTION_NAME))
NORETURN void sanity_check_fn(const char *assertion, const char *file, unsigned int line, const char *function)
Definition: debug.cpp:47

◆ sanity_check

#define sanity_check (   expr)    SANITY_CHECK(expr)

Function Documentation

◆ debug_set_exception_handler()

void debug_set_exception_handler ( )

Referenced by main().

+ Here is the caller graph for this function:

◆ fatal_error_fn()

NORETURN void fatal_error_fn ( const char *  msg,
const char *  file,
unsigned int  line,
const char *  function 
)

References errorstream, g_term_console, and TerminalChatConsole::stopAndWaitforThread().

+ Here is the call graph for this function:

◆ sanity_check_fn()

NORETURN void sanity_check_fn ( const char *  assertion,
const char *  file,
unsigned int  line,
const char *  function 
)

References errorstream, g_term_console, and TerminalChatConsole::stopAndWaitforThread().

+ Here is the call graph for this function: