From f5f865b1a6a9de101e6c1f5262b974a9dc59f60c Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 13 Sep 2005 21:23:31 +0000 Subject: [PATCH] more debugging help --- panda/src/display/config_display.cxx | 2 ++ panda/src/pgraph/nodePath.cxx | 6 +++--- panda/src/pgraph/pandaNode.cxx | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 579e32b788..b2d98032cb 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -24,6 +24,7 @@ #include "graphicsOutput.h" #include "graphicsBuffer.h" #include "graphicsWindow.h" +#include "graphicsDevice.h" #include "parasiteBuffer.h" ConfigureDef(config_display); @@ -270,5 +271,6 @@ init_libdisplay() { GraphicsOutput::init_type(); GraphicsWindow::init_type(); GraphicsBuffer::init_type(); + GraphicsDevice::init_type(); ParasiteBuffer::init_type(); } diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index d8b9985f84..893685cbe0 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -5365,11 +5365,11 @@ find_matches(NodePathCollection &result, FindApproxLevelEntry *level, FindApproxLevelEntry *deleted_entries = NULL; while (num_levels_remaining > 0 && level != NULL) { - if (pgraph_cat.is_debug()) { - pgraph_cat.debug() + if (pgraph_cat.is_spam()) { + pgraph_cat.spam() << "find_matches pass: " << result << ", " << max_matches << ", " << num_levels_remaining << "\n"; - level->write_level(pgraph_cat.debug(false), 4); + level->write_level(pgraph_cat.spam(false), 4); } num_levels_remaining--; diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 4f42746a1a..8b6ad1f2a0 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -339,6 +339,13 @@ PandaNode:: PandaNode(const string &name) : Namable(name) { + if (pgraph_cat.is_debug()) { + pgraph_cat.debug() + << "Constructing " << (void *)this << ", " << get_name() << "\n"; + } +#ifdef DO_MEMORY_USAGE + MemoryUsage::update_type(this, this); +#endif } //////////////////////////////////////////////////////////////////// @@ -348,6 +355,11 @@ PandaNode(const string &name) : //////////////////////////////////////////////////////////////////// PandaNode:: ~PandaNode() { + if (pgraph_cat.is_debug()) { + pgraph_cat.debug() + << "Destructing " << (void *)this << ", " << get_name() << "\n"; + } + // We shouldn't have any parents left by the time we destruct, or // there's a refcount fault somewhere. #ifndef NDEBUG @@ -387,6 +399,13 @@ PandaNode(const PandaNode ©) : TypedWritable(copy), Namable(copy) { + if (pgraph_cat.is_debug()) { + pgraph_cat.debug() + << "Copying " << (void *)this << ", " << get_name() << "\n"; + } +#ifdef DO_MEMORY_USAGE + MemoryUsage::update_type(this, this); +#endif // Copying a node does not copy its children. // Copy the other node's state.