summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-30 14:58:08 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-30 14:58:08 +0000
commita74bd368d4b7e575d6ecba8a8f232d87332b5a27 (patch)
treee70eba00e224ca1a3261f902d1546e9c083b4aaa
parent00c83baf3852d0dfe399f1b67ff7736afcbad2d8 (diff)
Add debugging code to lasso_node_impl_init_from_xml
* lasso/xml/xml.c: add more debugging code for the memory-debug flag.
-rw-r--r--lasso/xml/xml.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 169b6107..95e6c5d2 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -887,8 +887,14 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode)
if (class->node_data->keep_xmlnode) {
lasso_node_set_original_xmlnode(node, xmlnode);
}
+ if (lasso_flag_memory_debug == TRUE) {
+ fprintf(stderr, "Initializing %s (at %p)\n", G_OBJECT_TYPE_NAME(node), node);
+ }
while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) {
+ if (lasso_flag_memory_debug == TRUE) {
+ fprintf(stderr, " initializing %s\n", G_OBJECT_CLASS_NAME(class));
+ }
for (t = xmlnode->children; t; t = t->next) {
if (t->type == XML_TEXT_NODE) {
@@ -1008,6 +1014,9 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode)
xmlFree(tmp);
} else {
(*(void**)value) = tmp;
+ if (lasso_flag_memory_debug == TRUE) {
+ fprintf(stderr, " setting field %s/%s to value %p: %s\n", G_OBJECT_TYPE_NAME(node), snippet->name, *(void**)value, (char*)tmp);
+ }
}
break;
@@ -1051,6 +1060,10 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode)
(*(int*)value) = val;
} else {
lasso_assign_string((*(char**)value), tmp);
+ if (lasso_flag_memory_debug == TRUE) {
+ fprintf(stderr, " setting prop %s/%s to value %p: %s\n",
+ G_OBJECT_TYPE_NAME(node), snippet->name, *(void**)value, (char*)tmp);
+ }
}
xmlFree(tmp);
}