Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
debug.h File Reference
#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 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

void fatal_error_fn (const char *msg, const char *file, unsigned int line, const char *function)
 
void sanity_check_fn (const char *assertion, const char *file, unsigned int line, const char *function)
 
std::string debug_describe_exc (const std::exception &e)
 
void debug_set_exception_handler ()
 

Macro Definition Documentation

◆ BEGIN_DEBUG_EXCEPTION_HANDLER

◆ CATCH_UNHANDLED_EXCEPTIONS

#define CATCH_UNHANDLED_EXCEPTIONS   0

◆ END_DEBUG_EXCEPTION_HANDLER

◆ FATAL_ERROR

◆ 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:30
void fatal_error_fn(const char *msg, const char *file, unsigned int line, const char *function)
Definition debug.cpp:64

Referenced by KeyPress::KeyPress(), MapgenValleys::MapgenValleys(), ScriptApiBase::ScriptApiBase(), con::Peer::~Peer(), SingleMediaDownloader::addFile(), LBMContentMapping::addLBM(), LBMManager::addLBMDef(), ServerEnvironment::addPlayer(), StyleSpec::addState(), LBMManager::applyLBMs(), BiomeGen::assertChunkSize(), Schematic::clone(), NodeResolver::cloneTo(), LBMManager::createIntroductionTimesString(), find_packer(), gen_srp_v(), ClientEnvironment::getClientEnvEvent(), Client::getClientEvent(), StyleSpec::getColor(), ScriptApiBase::getCurrentModName(), porting::getDisplayDensity(), porting::getDisplaySize(), porting::getHomeOrFail(), porting::getInputDialogMessage(), porting::getInputDialogSelection(), porting::getInputDialogState(), getItemMesh(), porting::getLanguageAndroid(), porting::getLastInputDialogType(), con::Connection::getLocalStat(), Client::getMesh(), EmergeManager::getOptimalThread(), con::Connection::getPeerNoEx(), StyleSpec::getRect(), StyleSpec::getTexture(), ScriptApiSecurity::getThread(), StyleSpec::getVector2i(), EmergeManager::getWritableBiomeManager(), EmergeManager::getWritableDecorationManager(), EmergeManager::getWritableOreManager(), EmergeManager::getWritableSchematicManager(), porting::hasPhysicalKeyboardAndroid(), httpfetch_init(), ServerMap::initBlockMake(), EmergeManager::initMap(), EmergeManager::initMapgens(), LocalPlayer::isDead(), ModApiBase::l_deprecated_function(), Client::loadMedia(), GUIKeyChangeMenu::OnEvent(), porting::openURIAndroid(), Settings::operator=(), GUIFormSpecMenu::parseBackground(), Game::processClientEvents(), con::UDPPeer::processReliableSendCommand(), Client::ReceiveAll(), CItemDefManager::registerItem(), AsyncEngine::registerStateInitializer(), Client::request_media(), EmergeManager::resetMap(), CurlFetchThread::run(), ScriptApiBase::runCallbacksRaw(), AuthDatabaseLevelDB::saveAuth(), script_log_add_source(), script_register_packer(), Client::Send(), Server::Send(), ClientInterface::send(), ClientInterface::sendCustom(), Client::sendInventoryFields(), Client::sendNodemetaFields(), ClientInterface::sendToAll(), MapBlock::serialize(), NodeDefManager::serialize(), ClientMediaDownloader::serializeRequiredHashSet(), Schematic::serializeToLua(), Settings::setDefault(), RemoteClient::setEncryptedPassword(), ClientEnvironment::setLocalPlayer(), ScriptApiSecurity::setLuaEnv(), porting::shareFileAndroid(), porting::showComboBoxDialog(), porting::showTextInputDialog(), Client::startAuth(), Client::step(), and ScriptApiEnv::triggerABM().

◆ FUNCTION_NAME

◆ SANITY_CHECK

◆ sanity_check

#define sanity_check ( expr)    SANITY_CHECK(expr)

Referenced by ModifySafeMap< K, V >::ModifySafeMap(), RenderingEngine::RenderingEngine(), AsyncWorkerThread::~AsyncWorkerThread(), RenderingEngine::~RenderingEngine(), WieldMeshSceneNode::~WieldMeshSceneNode(), ServerEnvironment::addActiveObjectRaw(), TouchControls::applyContextControls(), Schematic::blitToVManip(), cloneMeshBuffer(), Client::connect(), ExtrusionMeshCache::create(), CItemDefManager::createClientCachedDirect(), ServerInventoryManager::createDetachedInventory(), createDevice(), createInventoryCubeImage(), con::Peer::DecUseCount(), ChatBuffer::deleteOldest(), GUIFormSpecMenu::drawMenu(), GUIFormSpecMenu::drawSelectedItem(), Server::dynamicAddMedia(), GUIModalMenu::enter(), ImageSource::generateImagePart(), TextureSource::generateTexture(), RenderingEngine::get_raw_device(), RenderingEngine::get_video_driver(), ServerInventoryManager::getInventory(), TextureSource::getPalette(), RenderingEngine::getWindowSize(), Client::handleCommand_AnnounceMedia(), Client::handleCommand_ItemDef(), Client::handleCommand_Media(), Client::handleCommand_NodeDef(), FontEngine::initFont(), porting::initializePaths(), con::IncomingSplitPacket::insert(), con::ReliablePacketBuffer::insert(), TextureSource::insertSourceImage(), ShaderSource::insertSourceShader(), ScriptApiItem::item_CraftPredict(), ModApiMainMenu::l_close(), ModApiMainMenu::l_do_async_callback(), ModApiMainMenu::l_get_content_translation(), LuaCamera::l_get_look_horizontal(), LuaCamera::l_get_look_vertical(), ModApiMainMenu::l_get_mainmenu_path(), LuaCamera::l_get_offset(), ModApiMainMenu::l_get_table_index(), ModApiMainMenu::l_set_background(), LuaCamera::l_set_camera_mode(), ModApiMainMenu::l_set_clouds(), ModApiMainMenu::l_set_formspec_prepend(), ModApiMainMenu::l_set_topleft_text(), ModApiMainMenu::l_show_keys_menu(), ModApiMainMenu::l_show_path_select_dialog(), ModApiMainMenu::l_start(), ModApiMainMenu::l_update_formspec(), ScriptApiBase::loadModFromMemory(), main(), con::makeSplitPacket(), LocalPlayer::move(), LocalPlayer::old_move(), GUIFormSpecMenu::OnEvent(), Server::overrideDayNightRatio(), Schematic::placeOnMap(), Schematic::placeOnVManip(), GUIFormSpecMenu::preprocessEvent(), con::UDPPeer::processReliableSendCommand(), read_config_file(), con::IncomingSplitPacket::reassemble(), TextureSource::rebuildImagesAndTextures(), TextureSource::rebuildTexture(), GUIFormSpecMenu::regenerateGui(), ClientMediaDownloader::remoteMediaReceived(), SingleMediaDownloader::remoteMediaReceived(), LambdaThread::rethrow(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), script_unpack(), Client::sendHaveMedia(), PlayerDatabaseFiles::serialize(), MapNode::serializeBulk(), Server::setClouds(), ServerInventoryManager::setInventoryModified(), Server::setLighting(), Server::setLocalPlayerAnimations(), Server::setMoon(), Server::setPlayerEyeOffset(), Server::setSky(), Server::setStars(), Server::setSun(), Server::stepPendingDynMediaCallbacks(), Settings::updateConfigObject(), and EnrichedString::updateDefaultColor().

Function Documentation

◆ debug_describe_exc()

std::string debug_describe_exc ( const std::exception & e)

Referenced by ClientLauncher::run(), and script_exception_wrapper().

+ Here is the caller graph for this function:

◆ debug_set_exception_handler()

void debug_set_exception_handler ( )

Referenced by main().

+ Here is the caller graph for this function:

◆ fatal_error_fn()

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

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

+ Here is the call graph for this function:

◆ sanity_check_fn()

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

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

+ Here is the call graph for this function: