Browse Source

more debugging help

David Rose 20 years ago
parent
commit
f5f865b1a6

+ 2 - 0
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();
 }

+ 3 - 3
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--;

+ 19 - 0
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 &copy) :
   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.