Pastebiniä käytetään pidempien tekstien säilömiseen jotka pitää laittaa talteen tai joita esim. ei voi sanoa irkissä tms kätevästi ilman hirveää floodimista. Lyhykäisiä tunnisteita saa arvaamalla satunnaisesti selville, joten ei kannata pasteta mitään erityisen yksityistä.
Tekstiä mahtuu maksimissaan 64 kilotavua per paste eli älä ihmettele jos tosi pitkät pastet katkeaa, jos taas TOSI isoja pasteja tunkkaa tänne niin tulee jopa virhe eikä paste mene edes läpi. Myäskään viagra- tai cialis-sanoja sisältäviä pasteja ei hyväksytä, sillä erinäiset spämmibotit puskevat niitä vähän väliä.
Pasten nimi (vapaaehtoinen):
Värjäys: ABAPActionScriptActionScript 3AdaANTLRANTLR With ActionScript TargetANTLR With C# TargetANTLR With CPP TargetANTLR With Java TargetANTLR With ObjectiveC TargetANTLR With Perl TargetANTLR With Python TargetANTLR With Ruby TargetApacheConfAppleScriptaspx-csaspx-vbAsymptoteautohotkeyAwkBase MakefileBashBash SessionBatchfileBBCodeBefungeBlitzMaxBooBrainfuckBroCC#C++c-objdumpCFEngine3cfstatementCheetahClojureCMakeCoffeeScriptColdfusion HTMLCommon LispCoqcpp-objdumpCSSCSS+Django/JinjaCSS+Genshi TextCSS+MakoCSS+MyghtyCSS+PHPCSS+RubyCSS+SmartyCythonDd-objdumpDarcs PatchDartDebian Control fileDebian SourcelistDelphiDiffDjango/JinjaDTDDuelDylaneCECLElixirElixir iex sessionEmbedded RagelERBErlangErlang erl sessionEvoqueFactorFancyFantomFelixFortranFSharpGASGenshiGenshi TextGettext CatalogGherkinGLSLGnuplotGoGoodData-CLGosuGosu TemplateGroffGroovyHamlHaskellhaXeHTMLHTML+CheetahHTML+Django/JinjaHTML+EvoqueHTML+GenshiHTML+MakoHTML+MyghtyHTML+PHPHTML+SmartyHTML+VelocityHTTPHybrisINIIoIokeIRC logsJadeJavaJava Server PageJavaScriptJavaScript+CheetahJavaScript+Django/JinjaJavaScript+Genshi TextJavaScript+MakoJavaScript+MyghtyJavaScript+PHPJavaScript+RubyJavaScript+SmartyJSONKotlinLighttpd configuration fileLiterate HaskellLLVMLogtalkLuaMakefileMakoMAQLMasonMatlabMatlab sessionMiniDModelicaModula-2MoinMoin/Trac Wiki markupMOOCodeMoonScriptMuPADMXMLMyghtyMySQLNASMNemerleNewLispNewspeakNginx configuration fileNimrodNumPyobjdumpObjective-CObjective-JOCamlOctaveOocOpaOpenEdge ABLPerlPHPPL/pgSQLPostgreSQL console (psql)PostgreSQL SQL dialectPostScriptPOVRayPowerShellPrologPropertiesProtocol BufferPyPy LogPythonPython 3Python 3.0 TracebackPython console sessionPython TracebackRagelRagel in C HostRagel in CPP HostRagel in D HostRagel in Java HostRagel in Objective C HostRagel in Ruby HostRaw token dataRConsoleREBOLRedcodereStructuredTextRHTMLRubyRuby irb sessionSSassScalaScalate Server PageScamlSchemeScilabSCSSSmalltalkSmartySnobolSQLsqlite3conSquidConfStandard MLsystemverilogTclTcshTeaTeXText onlyUrbiScriptValaVB.netVelocityverilogvhdlVimLXMLXML+CheetahXML+Django/JinjaXML+EvoqueXML+MakoXML+MyghtyXML+PHPXML+RubyXML+SmartyXML+VelocityXQueryXSLTYAML
From 2044e2185129886a57192672c5b5a878b2c6ab47 Mon Sep 17 00:00:00 2001 From: Perttu Ahola <celeron55@gmail.com> Date: Mon, 5 Aug 2013 18:24:41 +0300 Subject: [PATCH] Remove the ancient DebugStack framework - it hasn't turned out to be useful enough. --- minetest.conf.example | 1 - src/client.cpp | 14 ----- src/clientmap.cpp | 4 -- src/debug.cpp | 153 ----------------------------------------------- src/debug.h | 56 +++-------------- src/defaultsettings.cpp | 1 - src/emerge.cpp | 1 - src/environment.cpp | 6 -- src/game.cpp | 11 ---- src/guiKeyChangeMenu.cpp | 1 - src/inventory.cpp | 4 -- src/inventorymanager.cpp | 2 - src/main.cpp | 5 -- src/map.cpp | 34 ----------- src/porting.cpp | 11 ---- src/server.cpp | 62 +------------------ src/test.cpp | 4 -- 17 files changed, 10 insertions(+), 360 deletions(-) diff --git a/minetest.conf.example b/minetest.conf.example index 4c049f8..4f6448f 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -56,7 +56,6 @@ # If false aux1 is used to fly fast #always_fly_fast = true # Some (temporary) keys for debugging -#keymap_print_debug_stacks = KEY_KEY_P #keymap_quicktune_prev = KEY_HOME #keymap_quicktune_next = KEY_END #keymap_quicktune_dec = KEY_NEXT diff --git a/src/client.cpp b/src/client.cpp index f9908ad..e333e7b 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -101,8 +101,6 @@ static std::string getMediaCacheDir() */ void MeshUpdateQueue::addBlock(v3s16 p, MeshMakeData *data, bool ack_block_to_server, bool urgent) { - DSTACK(__FUNCTION_NAME); - assert(data); JMutexAutoLock lock(m_mutex); @@ -171,7 +169,6 @@ void * MeshUpdateThread::Thread() log_register_thread("MeshUpdateThread"); - DSTACK(__FUNCTION_NAME); BEGIN_DEBUG_EXCEPTION_HANDLER @@ -227,8 +224,6 @@ void * MediaFetchThread::Thread() log_register_thread("MediaFetchThread"); - DSTACK(__FUNCTION_NAME); - BEGIN_DEBUG_EXCEPTION_HANDLER #if USE_CURL @@ -378,7 +373,6 @@ void * MediaFetchThread::Thread() void Client::connect(Address address) { - DSTACK(__FUNCTION_NAME); //JMutexAutoLock lock(m_con_mutex); //bulk comment-out m_con.SetTimeoutMs(0); m_con.Connect(address); @@ -399,7 +393,6 @@ bool Client::connectedAndInitialized() void Client::step(float dtime) { - DSTACK(__FUNCTION_NAME); // Limit a bit if(dtime > 2.0) @@ -1068,7 +1061,6 @@ void Client::request_media(const std::list<MediaRequest> &file_requests) void Client::ReceiveAll() { - DSTACK(__FUNCTION_NAME); u32 start_ms = porting::getTimeMs(); for(;;) { @@ -1096,7 +1088,6 @@ void Client::ReceiveAll() void Client::Receive() { - DSTACK(__FUNCTION_NAME); SharedBuffer<u8> data; u16 sender_peer_id; u32 datasize; @@ -1114,8 +1105,6 @@ void Client::Receive() */ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) { - DSTACK(__FUNCTION_NAME); - // Ignore packets that don't even fit a command if(datasize < 2) { @@ -2361,7 +2350,6 @@ void Client::sendChangePassword(const std::wstring oldpassword, void Client::sendDamage(u8 damage) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOSERVER_DAMAGE); @@ -2376,7 +2364,6 @@ void Client::sendDamage(u8 damage) void Client::sendBreath(u16 breath) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOSERVER_BREATH); @@ -2390,7 +2377,6 @@ void Client::sendBreath(u16 breath) void Client::sendRespawn() { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOSERVER_RESPAWN); diff --git a/src/clientmap.cpp b/src/clientmap.cpp index e0c41c7..98b29e2 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -70,7 +70,6 @@ MapSector * ClientMap::emergeSector(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); // Check that it doesn't exist already try{ return getSectorNoGenerate(p2d); @@ -93,7 +92,6 @@ MapSector * ClientMap::emergeSector(v2s16 p2d) #if 0 void ClientMap::deSerializeSector(v2s16 p2d, std::istream &is) { - DSTACK(__FUNCTION_NAME); ClientMapSector *sector = NULL; //JMutexAutoLock lock(m_sector_mutex); // Bulk comment-out @@ -406,8 +404,6 @@ struct MeshBufListList void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) { - DSTACK(__FUNCTION_NAME); - bool is_transparent_pass = pass == scene::ESNRP_TRANSPARENT; std::string prefix; diff --git a/src/debug.cpp b/src/debug.cpp index 2e4992a..eba4015 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -71,163 +71,12 @@ void assert_fail(const char *assertion, const char *file, (unsigned long)get_current_thread_id(), file, line, function, assertion); - debug_stacks_print(); - if(g_debugstreams[1]) fclose(g_debugstreams[1]); abort(); } -/* - DebugStack -*/ - -DebugStack::DebugStack(threadid_t id) -{ - threadid = id; - stack_i = 0; - stack_max_i = 0; - memset(stack, 0, DEBUG_STACK_SIZE*DEBUG_STACK_TEXT_SIZE); -} - -void DebugStack::print(FILE *file, bool everything) -{ - fprintf(file, "DEBUG STACK FOR THREAD %lx:\n", - (unsigned long)threadid); - - for(int i=0; i<stack_max_i; i++) - { - if(i == stack_i && everything == false) - break; - - if(i < stack_i) - fprintf(file, "#%d %s\n", i, stack[i]); - else - fprintf(file, "(Leftover data: #%d %s)\n", i, stack[i]); - } - - if(stack_i == DEBUG_STACK_SIZE) - fprintf(file, "Probably overflown.\n"); -} - -void DebugStack::print(std::ostream &os, bool everything) -{ - os<<"DEBUG STACK FOR THREAD "<<(unsigned long)threadid<<": "<<std::endl; - - for(int i=0; i<stack_max_i; i++) - { - if(i == stack_i && everything == false) - break; - - if(i < stack_i) - os<<"#"<<i<<" "<<stack[i]<<std::endl; - else - os<<"(Leftover data: #"<<i<<" "<<stack[i]<<")"<<std::endl; - } - - if(stack_i == DEBUG_STACK_SIZE) - os<<"Probably overflown."<<std::endl; -} - -std::map<threadid_t, DebugStack*> g_debug_stacks; -JMutex g_debug_stacks_mutex; - -void debug_stacks_init() -{ - g_debug_stacks_mutex.Init(); -} - -void debug_stacks_print_to(std::ostream &os) -{ - JMutexAutoLock lock(g_debug_stacks_mutex); - - os<<"Debug stacks:"<<std::endl; - - for(std::map<threadid_t, DebugStack*>::iterator - i = g_debug_stacks.begin(); - i != g_debug_stacks.end(); ++i) - { - i->second->print(os, false); - } -} - -void debug_stacks_print() -{ - JMutexAutoLock lock(g_debug_stacks_mutex); - - DEBUGPRINT("Debug stacks:\n"); - - for(std::map<threadid_t, DebugStack*>::iterator - i = g_debug_stacks.begin(); - i != g_debug_stacks.end(); ++i) - { - DebugStack *stack = i->second; - - for(int i=0; i<DEBUGSTREAM_COUNT; i++) - { - if(g_debugstreams[i] != NULL) - stack->print(g_debugstreams[i], true); - } - } -} - -DebugStacker::DebugStacker(const char *text) -{ - threadid_t threadid = get_current_thread_id(); - - JMutexAutoLock lock(g_debug_stacks_mutex); - - std::map<threadid_t, DebugStack*>::iterator n; - n = g_debug_stacks.find(threadid); - if(n != g_debug_stacks.end()) - { - m_stack = n->second; - } - else - { - /*DEBUGPRINT("Creating new debug stack for thread %x\n", - (unsigned int)threadid);*/ - m_stack = new DebugStack(threadid); - g_debug_stacks[threadid] = m_stack; - } - - if(m_stack->stack_i >= DEBUG_STACK_SIZE) - { - m_overflowed = true; - } - else - { - m_overflowed = false; - - snprintf(m_stack->stack[m_stack->stack_i], - DEBUG_STACK_TEXT_SIZE, "%s", text); - m_stack->stack_i++; - if(m_stack->stack_i > m_stack->stack_max_i) - m_stack->stack_max_i = m_stack->stack_i; - } -} - -DebugStacker::~DebugStacker() -{ - JMutexAutoLock lock(g_debug_stacks_mutex); - - if(m_overflowed == true) - return; - - m_stack->stack_i--; - - if(m_stack->stack_i == 0) - { - threadid_t threadid = m_stack->threadid; - /*DEBUGPRINT("Deleting debug stack for thread %x\n", - (unsigned int)threadid);*/ - delete m_stack; - g_debug_stacks.erase(threadid); - } -} - - #ifdef _MSC_VER #if CATCH_UNHANDLED_EXCEPTIONS == 1 void se_trans_func(unsigned int u, EXCEPTION_POINTERS* pExp) @@ -257,5 +106,3 @@ void se_trans_func(unsigned int u, EXCEPTION_POINTERS* pExp) #endif #endif - - diff --git a/src/debug.h b/src/debug.h index 31855cc..1049086 100644 --- a/src/debug.h +++ b/src/debug.h @@ -148,52 +148,6 @@ __NORETURN extern void assert_fail( #define assert(expr) ASSERT(expr) /* - DebugStack -*/ - -#define DEBUG_STACK_SIZE 50 -#define DEBUG_STACK_TEXT_SIZE 300 - -struct DebugStack -{ - DebugStack(threadid_t id); - void print(FILE *file, bool everything); - void print(std::ostream &os, bool everything); - - threadid_t threadid; - char stack[DEBUG_STACK_SIZE][DEBUG_STACK_TEXT_SIZE]; - int stack_i; // Points to the lowest empty position - int stack_max_i; // Highest i that was seen -}; - -extern std::map<threadid_t, DebugStack*> g_debug_stacks; -extern JMutex g_debug_stacks_mutex; - -extern void debug_stacks_init(); -extern void debug_stacks_print_to(std::ostream &os); -extern void debug_stacks_print(); - -class DebugStacker -{ -public: - DebugStacker(const char *text); - ~DebugStacker(); - -private: - DebugStack *m_stack; - bool m_overflowed; -}; - -#define DSTACK(msg)\ - DebugStacker __debug_stacker(msg); - -#define DSTACKF(...)\ - char __buf[DEBUG_STACK_TEXT_SIZE];\ - snprintf(__buf,\ - DEBUG_STACK_TEXT_SIZE, __VA_ARGS__);\ - DebugStacker __debug_stacker(__buf); - -/* Packet counter */ @@ -245,7 +199,15 @@ class PacketCounter }; /* - These should be put into every thread + These should be put into the beginning and end of every thread: + + BEGIN_PORTABLE_DEBUG_EXCEPTION_HANDLER + END_DEBUG_EXCEPTION_HANDLER(errorstream) + + The debug exception handlers will print out any fall-through exception in + RELEASE builds, and will not do anything in DEBUG builds so that a debugger + can instead more helpfully provide a backtrace and other facilities. On + Windows they also catch certain kinds of OS-level failures. */ #if CATCH_UNHANDLED_EXCEPTIONS == 1 diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 326e11b..33bba94 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -61,7 +61,6 @@ void set_default_settings(Settings *settings) settings->setDefault("always_fly_fast", "true"); // Some (temporary) keys for debugging - settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); settings->setDefault("keymap_quicktune_prev", "KEY_HOME"); settings->setDefault("keymap_quicktune_next", "KEY_END"); settings->setDefault("keymap_quicktune_dec", "KEY_NEXT"); diff --git a/src/emerge.cpp b/src/emerge.cpp index f977637..2ad69a8 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -398,7 +398,6 @@ bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b, void *EmergeThread::Thread() { ThreadStarted(); log_register_thread("EmergeThread" + itos(id)); - DSTACK(__FUNCTION_NAME); BEGIN_DEBUG_EXCEPTION_HANDLER v3s16 last_tried_pos(-32768,-32768,-32768); // For error output diff --git a/src/environment.cpp b/src/environment.cpp index 57fdfd7..2a8abb6 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -68,7 +68,6 @@ void Environment::addPlayer(Player *player) { - DSTACK(__FUNCTION_NAME); /* Check that peer_ids are unique. Also check that names are unique. @@ -85,7 +84,6 @@ void Environment::addPlayer(Player *player) void Environment::removePlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); re_search: for(std::list<Player*>::iterator i = m_players.begin(); i != m_players.end(); ++i) @@ -1038,7 +1036,6 @@ void ServerEnvironment::clearAllObjects() void ServerEnvironment::step(float dtime) { - DSTACK(__FUNCTION_NAME); //TimeTaker timer("ServerEnv step"); @@ -2013,7 +2010,6 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) void ClientEnvironment::addPlayer(Player *player) { - DSTACK(__FUNCTION_NAME); /* It is a failure if player is local and there already is a local player @@ -2037,8 +2033,6 @@ LocalPlayer * ClientEnvironment::getLocalPlayer() void ClientEnvironment::step(float dtime) { - DSTACK(__FUNCTION_NAME); - /* Step time of day */ stepTimeOfDay(dtime); diff --git a/src/game.cpp b/src/game.cpp index 205c345..b3c6a30 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2065,17 +2065,6 @@ void the_game( } } - // Print debug stacks - if(input->wasKeyDown(getKeySetting("keymap_print_debug_stacks"))) - { - dstream<<"-----------------------------------------" - <<std::endl; - dstream<<DTIME<<"Printing debug stacks:"<<std::endl; - dstream<<"-----------------------------------------" - <<std::endl; - debug_stacks_print(); - } - /* Mouse and camera control NOTE: Do this before client.setPlayerControl() to not cause a camera lag of one frame diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index c660ed8..5149ec9 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -413,5 +413,4 @@ void GUIKeyChangeMenu::init_keys() this->add_key(GUI_ID_KEY_FAST_BUTTON, wgettext("Toggle fast"), "keymap_fastmove"); this->add_key(GUI_ID_KEY_NOCLIP_BUTTON, wgettext("Toggle noclip"), "keymap_noclip"); this->add_key(GUI_ID_KEY_RANGE_BUTTON, wgettext("Range select"), "keymap_rangeselect"); - this->add_key(GUI_ID_KEY_DUMP_BUTTON, wgettext("Print stacks"), "keymap_print_debug_stacks"); } diff --git a/src/inventory.cpp b/src/inventory.cpp index 2ce50e0..cbaa44a 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -126,8 +126,6 @@ static std::string deSerializeJsonStringIfNeeded(std::istream &is) void ItemStack::serialize(std::ostream &os) const { - DSTACK(__FUNCTION_NAME); - if(empty()) return; @@ -151,8 +149,6 @@ void ItemStack::serialize(std::ostream &os) const void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef) { - DSTACK(__FUNCTION_NAME); - clear(); // Read name diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index 6187675..b3a04fc 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -763,8 +763,6 @@ void ICraftAction::clientApply(InventoryManager *mgr, IGameDef *gamedef) bool getCraftingResult(Inventory *inv, ItemStack& result, bool decrementInput, IGameDef *gamedef) { - DSTACK(__FUNCTION_NAME); - result.clear(); // Get the InventoryList in which we will operate diff --git a/src/main.cpp b/src/main.cpp index b3aa9c9..686955a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -866,10 +866,6 @@ int main(int argc, char *argv[]) infostream<<"path_share = "<<porting::path_share<<std::endl; infostream<<"path_user = "<<porting::path_user<<std::endl; - // Initialize debug stacks - debug_stacks_init(); - DSTACK(__FUNCTION_NAME); - // Debug handler BEGIN_DEBUG_EXCEPTION_HANDLER @@ -1083,7 +1079,6 @@ int main(int argc, char *argv[]) g_settings->set("server_dedicated", run_dedicated_server ? "true" : "false"); if(run_dedicated_server) { - DSTACK("Dedicated server branch"); // Create time getter if built with Irrlicht #ifndef SERVER g_timegetter = new SimpleTimeGetter(); diff --git a/src/map.cpp b/src/map.cpp index 90cd498..be73aeb 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -210,7 +210,6 @@ void Map::setNode(v3s16 p, MapNode & n) <<" while trying to replace \"" <<m_gamedef->ndef()->get(block->getNodeNoCheck(relpos)).name <<"\" at "<<PP(p)<<" (block "<<PP(blockpos)<<")"<<std::endl; - debug_stacks_print_to(infostream); return; } block->setNodeNoCheck(relpos, n); @@ -1639,7 +1638,6 @@ void Map::transformLiquidsFinite(std::map<v3s16, MapBlock*> & modified_blocks) { INodeDefManager *nodemgr = m_gamedef->ndef(); - DSTACK(__FUNCTION_NAME); //TimeTaker timer("transformLiquids()"); u32 loopcount = 0; @@ -1998,7 +1996,6 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks) INodeDefManager *nodemgr = m_gamedef->ndef(); - DSTACK(__FUNCTION_NAME); //TimeTaker timer("transformLiquids()"); u32 loopcount = 0; @@ -2834,10 +2831,6 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data, ServerMapSector * ServerMap::createSector(v2s16 p2d) { - DSTACKF("%s: p2d=(%d,%d)", - __FUNCTION_NAME, - p2d.X, p2d.Y); - /* Check if it exists already in memory */ @@ -2900,8 +2893,6 @@ MapBlock * ServerMap::generateBlock( std::map<v3s16, MapBlock*> &modified_blocks ) { - DSTACKF("%s: p=(%d,%d,%d)", __FUNCTION_NAME, p.X, p.Y, p.Z); - /*infostream<<"generateBlock(): " <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")" <<std::endl;*/ @@ -3009,9 +3000,6 @@ MapBlock * ServerMap::generateBlock( MapBlock * ServerMap::createBlock(v3s16 p) { - DSTACKF("%s: p=(%d,%d,%d)", - __FUNCTION_NAME, p.X, p.Y, p.Z); - /* Do not create over-limit */ @@ -3073,10 +3061,6 @@ MapBlock * ServerMap::createBlock(v3s16 p) MapBlock * ServerMap::emergeBlock(v3s16 p, bool create_blank) { - DSTACKF("%s: p=(%d,%d,%d), create_blank=%d", - __FUNCTION_NAME, - p.X, p.Y, p.Z, create_blank); - { MapBlock *block = getBlockNoCreateNoEx(p); if(block && block->isDummy() == false) @@ -3326,7 +3310,6 @@ v3s16 ServerMap::getBlockPos(std::string sectordir, std::string blockfile) void ServerMap::save(ModifiedState save_level) { - DSTACK(__FUNCTION_NAME); if(m_map_saving_enabled == false) { infostream<<"WARNING: Not saving map, saving disabled."<<std::endl; @@ -3482,8 +3465,6 @@ void ServerMap::listAllLoadedBlocks(std::list<v3s16> &dst) void ServerMap::saveMapMeta() { - DSTACK(__FUNCTION_NAME); - /*infostream<<"ServerMap::saveMapMeta(): " <<"seed="<<m_seed <<std::endl;*/ @@ -3511,8 +3492,6 @@ void ServerMap::saveMapMeta() void ServerMap::loadMapMeta() { - DSTACK(__FUNCTION_NAME); - /*infostream<<"ServerMap::loadMapMeta(): Loading map metadata" <<std::endl;*/ @@ -3566,7 +3545,6 @@ void ServerMap::loadMapMeta() void ServerMap::saveSectorMeta(ServerMapSector *sector) { - DSTACK(__FUNCTION_NAME); // Format used for writing u8 version = SER_FMT_VER_HIGHEST_WRITE; // Get destination @@ -3586,7 +3564,6 @@ void ServerMap::saveSectorMeta(ServerMapSector *sector) MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load) { - DSTACK(__FUNCTION_NAME); // Get destination v2s16 p2d = getSectorPos(sectordir); @@ -3627,8 +3604,6 @@ MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load bool ServerMap::loadSectorMeta(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); - MapSector *sector = NULL; // The directory layout we're going to load from. @@ -3671,8 +3646,6 @@ bool ServerMap::loadSectorMeta(v2s16 p2d) #if 0 bool ServerMap::loadSectorFull(v2s16 p2d) { - DSTACK(__FUNCTION_NAME); - MapSector *sector = NULL; // The directory layout we're going to load from. @@ -3754,7 +3727,6 @@ void ServerMap::endSave() { void ServerMap::saveBlock(MapBlock *block) { - DSTACK(__FUNCTION_NAME); /* Dummy blocks are not written */ @@ -3827,8 +3799,6 @@ void ServerMap::saveBlock(MapBlock *block) void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSector *sector, bool save_after_load) { - DSTACK(__FUNCTION_NAME); - std::string fullpath = sectordir+DIR_DELIM+blockfile; try{ @@ -3903,8 +3873,6 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load) { - DSTACK(__FUNCTION_NAME); - try { std::istringstream is(*blob, std::ios_base::binary); @@ -3972,8 +3940,6 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool MapBlock* ServerMap::loadBlock(v3s16 blockpos) { - DSTACK(__FUNCTION_NAME); - v2s16 p2d(blockpos.X, blockpos.Z); if(!loadFromFolders()) { diff --git a/src/porting.cpp b/src/porting.cpp index 84df15b..6448c82 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -69,12 +69,6 @@ void sigint_handler(int sig) { dstream<<DTIME<<"INFO: sigint_handler(): " <<"Ctrl-C pressed, shutting down."<<std::endl; - - // Comment out for less clutter when testing scripts - /*dstream<<DTIME<<"INFO: sigint_handler(): " - <<"Printing debug stacks"<<std::endl; - debug_stacks_print();*/ - g_killed = true; } else @@ -104,11 +98,6 @@ void signal_handler_init(void) { dstream<<DTIME<<"INFO: event_handler(): " <<"Ctrl+C, Close Event, Logoff Event or Shutdown Event, shutting down."<<std::endl; - // Comment out for less clutter when testing scripts - /*dstream<<DTIME<<"INFO: event_handler(): " - <<"Printing debug stacks"<<std::endl; - debug_stacks_print();*/ - g_killed = true; } else diff --git a/src/server.cpp b/src/server.cpp index 8c67846..dfc6da3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -66,8 +66,6 @@ void * ServerThread::Thread() log_register_thread("ServerThread"); - DSTACK(__FUNCTION_NAME); - BEGIN_DEBUG_EXCEPTION_HANDLER while(getRun()) @@ -129,8 +127,6 @@ v3f ServerSoundParams::getPos(ServerEnvironment *env, bool *pos_exists) const void RemoteClient::GetNextBlocks(Server *server, float dtime, std::vector<PrioritySortedBlockTransfer> &dest) { - DSTACK(__FUNCTION_NAME); - /*u32 timer_result; TimeTaker timer("RemoteClient::GetNextBlocks", &timer_result);*/ @@ -946,7 +942,6 @@ void PlayerInfo::PrintLine(std::ostream *s) void Server::start(unsigned short port) { - DSTACK(__FUNCTION_NAME); infostream<<"Starting server on port "<<port<<"..."<<std::endl; // Stop thread if already running @@ -975,8 +970,6 @@ void Server::start(unsigned short port) void Server::stop() { - DSTACK(__FUNCTION_NAME); - infostream<<"Server: Stopping and waiting threads"<<std::endl; // Stop threads (set run=false first so both start stopping) @@ -990,7 +983,6 @@ void Server::stop() void Server::step(float dtime) { - DSTACK(__FUNCTION_NAME); // Limit a bit if(dtime > 2.0) dtime = 2.0; @@ -1007,8 +999,6 @@ void Server::step(float dtime) void Server::AsyncRunStep() { - DSTACK(__FUNCTION_NAME); - g_profiler->add("Server::AsyncRunStep (num)", 1); float dtime; @@ -1697,7 +1687,6 @@ void Server::AsyncRunStep() void Server::Receive() { - DSTACK(__FUNCTION_NAME); SharedBuffer<u8> data; u16 peer_id; u32 datasize; @@ -1738,7 +1727,6 @@ void Server::Receive() void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) { - DSTACK(__FUNCTION_NAME); // Environment is locked first. JMutexAutoLock envlock(m_env_mutex); JMutexAutoLock conlock(m_con_mutex); @@ -3231,8 +3219,7 @@ void Server::setInventoryModified(const InventoryLocation &loc) //std::list<PlayerInfo> Server::getPlayerInfo() //{ -// DSTACK(__FUNCTION_NAME); -// JMutexAutoLock envlock(m_env_mutex); +//// JMutexAutoLock envlock(m_env_mutex); // JMutexAutoLock conlock(m_con_mutex); // // std::list<PlayerInfo> list; @@ -3273,7 +3260,6 @@ void Server::setInventoryModified(const InventoryLocation &loc) void Server::peerAdded(con::Peer *peer) { - DSTACK(__FUNCTION_NAME); verbosestream<<"Server::peerAdded(): peer->id=" <<peer->id<<std::endl; @@ -3286,7 +3272,6 @@ void Server::peerAdded(con::Peer *peer) void Server::deletingPeer(con::Peer *peer, bool timeout) { - DSTACK(__FUNCTION_NAME); verbosestream<<"Server::deletingPeer(): peer->id=" <<peer->id<<", timeout="<<timeout<<std::endl; @@ -3303,7 +3288,6 @@ void Server::deletingPeer(con::Peer *peer, bool timeout) void Server::SendMovement(con::Connection &con, u16 peer_id) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_MOVEMENT); @@ -3329,7 +3313,6 @@ void Server::SendMovement(con::Connection &con, u16 peer_id) void Server::SendHP(con::Connection &con, u16 peer_id, u8 hp) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_HP); @@ -3344,7 +3327,6 @@ void Server::SendHP(con::Connection &con, u16 peer_id, u8 hp) void Server::SendBreath(con::Connection &con, u16 peer_id, u16 breath) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_BREATH); @@ -3360,7 +3342,6 @@ void Server::SendBreath(con::Connection &con, u16 peer_id, u16 breath) void Server::SendAccessDenied(con::Connection &con, u16 peer_id, const std::wstring &reason) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_ACCESS_DENIED); @@ -3376,7 +3357,6 @@ void Server::SendAccessDenied(con::Connection &con, u16 peer_id, void Server::SendDeathscreen(con::Connection &con, u16 peer_id, bool set_camera_point_target, v3f camera_point_target) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_DEATHSCREEN); @@ -3393,7 +3373,6 @@ void Server::SendDeathscreen(con::Connection &con, u16 peer_id, void Server::SendItemDef(con::Connection &con, u16 peer_id, IItemDefManager *itemdef, u16 protocol_version) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); /* @@ -3420,7 +3399,6 @@ void Server::SendItemDef(con::Connection &con, u16 peer_id, void Server::SendNodeDef(con::Connection &con, u16 peer_id, INodeDefManager *nodedef, u16 protocol_version) { - DSTACK(__FUNCTION_NAME); std::ostringstream os(std::ios_base::binary); /* @@ -3450,8 +3428,6 @@ void Server::SendNodeDef(con::Connection &con, u16 peer_id, void Server::SendInventory(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -3476,8 +3452,6 @@ void Server::SendInventory(u16 peer_id) void Server::SendChatMessage(u16 peer_id, const std::wstring &message) { - DSTACK(__FUNCTION_NAME); - std::ostringstream os(std::ios_base::binary); u8 buf[12]; @@ -3507,8 +3481,6 @@ void Server::SendChatMessage(u16 peer_id, const std::wstring &message) void Server::SendShowFormspecMessage(u16 peer_id, const std::string formspec, const std::string formname) { - DSTACK(__FUNCTION_NAME); - std::ostringstream os(std::ios_base::binary); u8 buf[12]; @@ -3530,8 +3502,6 @@ void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f accelerat float expirationtime, float size, bool collisiondetection, std::string texture) { - DSTACK(__FUNCTION_NAME); - std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_SPAWN_PARTICLE); writeV3F1000(os, pos); @@ -3574,8 +3544,6 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3 v3f minvel, v3f maxvel, v3f minacc, v3f maxacc, float minexptime, float maxexptime, float minsize, float maxsize, bool collisiondetection, std::string texture, u32 id) { - DSTACK(__FUNCTION_NAME); - std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_ADD_PARTICLESPAWNER); @@ -3625,8 +3593,6 @@ void Server::SendAddParticleSpawnerAll(u16 amount, float spawntime, v3f minpos, void Server::SendDeleteParticleSpawner(u16 peer_id, u32 id) { - DSTACK(__FUNCTION_NAME); - std::ostringstream os(std::ios_base::binary); writeU16(os, TOCLIENT_DELETE_PARTICLESPAWNER); @@ -3779,7 +3745,6 @@ void Server::BroadcastChatMessage(const std::wstring &message) void Server::SendPlayerHP(u16 peer_id) { - DSTACK(__FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); playersao->m_hp_not_sent = false; @@ -3788,7 +3753,6 @@ void Server::SendPlayerHP(u16 peer_id) void Server::SendPlayerBreath(u16 peer_id) { - DSTACK(__FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); playersao->m_breath_not_sent = false; @@ -3797,7 +3761,6 @@ void Server::SendPlayerBreath(u16 peer_id) void Server::SendMovePlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); Player *player = m_env->getPlayer(peer_id); assert(player); @@ -4081,8 +4044,6 @@ void Server::setBlockNotSent(v3s16 p) void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto_version) { - DSTACK(__FUNCTION_NAME); - v3s16 p = block->getPos(); #if 0 @@ -4135,8 +4096,6 @@ void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto void Server::SendBlocks(float dtime) { - DSTACK(__FUNCTION_NAME); - JMutexAutoLock envlock(m_env_mutex); JMutexAutoLock conlock(m_con_mutex); @@ -4206,8 +4165,6 @@ void Server::SendBlocks(float dtime) void Server::fillMediaCache() { - DSTACK(__FUNCTION_NAME); - infostream<<"Server: Calculating media file checksums"<<std::endl; // Collect all media file paths @@ -4315,8 +4272,6 @@ struct SendableMediaAnnouncement void Server::sendMediaAnnouncement(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - verbosestream<<"Server: Announcing files to id("<<peer_id<<")" <<std::endl; @@ -4379,8 +4334,6 @@ struct SendableMedia void Server::sendRequestedMedia(u16 peer_id, const std::list<MediaRequest> &tosend) { - DSTACK(__FUNCTION_NAME); - verbosestream<<"Server::sendRequestedMedia(): " <<"Sending files to client"<<std::endl; @@ -4513,8 +4466,6 @@ void Server::sendDetachedInventory(const std::string &name, u16 peer_id) void Server::sendDetachedInventoryToAll(const std::string &name) { - DSTACK(__FUNCTION_NAME); - for(std::map<u16, RemoteClient*>::iterator i = m_clients.begin(); i != m_clients.end(); ++i){ @@ -4525,8 +4476,6 @@ void Server::sendDetachedInventoryToAll(const std::string &name) void Server::sendDetachedInventories(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - for(std::map<std::string, Inventory*>::iterator i = m_detached_inventories.begin(); i != m_detached_inventories.end(); i++){ @@ -4542,8 +4491,6 @@ void Server::sendDetachedInventories(u16 peer_id) void Server::DiePlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -4562,8 +4509,6 @@ void Server::DiePlayer(u16 peer_id) void Server::RespawnPlayer(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); @@ -4582,8 +4527,6 @@ void Server::RespawnPlayer(u16 peer_id) void Server::UpdateCrafting(u16 peer_id) { - DSTACK(__FUNCTION_NAME); - Player* player = m_env->getPlayer(peer_id); assert(player); @@ -4600,7 +4543,6 @@ void Server::UpdateCrafting(u16 peer_id) RemoteClient* Server::getClient(u16 peer_id) { - DSTACK(__FUNCTION_NAME); //JMutexAutoLock lock(m_con_mutex); std::map<u16, RemoteClient*>::iterator n; n = m_clients.find(peer_id); @@ -5340,8 +5282,6 @@ void Server::handlePeerChanges() void dedicated_server_loop(Server &server, bool &kill) { - DSTACK(__FUNCTION_NAME); - verbosestream<<"dedicated_server_loop()"<<std::endl; IntervalLimiter m_profiler_interval; diff --git a/src/test.cpp b/src/test.cpp index fa7a824..5daae50 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -1633,8 +1633,6 @@ struct TestConnection: public TestBase void Run() { - DSTACK("TestConnection::Run"); - TestHelpers(); /* @@ -1980,8 +1978,6 @@ struct TestConnection: public TestBase void run_tests() { - DSTACK(__FUNCTION_NAME); - int tests_run = 0; int tests_failed = 0; -- 1.7.12