_PyObject_Dump(): print the type of the object. This is by far the

most frequently interesting information IMO.  Also tidy up the output.
This commit is contained in:
Guido van Rossum 2001-09-14 15:50:08 +00:00
parent 4441001b56
commit 5f5512d246
1 changed files with 8 additions and 2 deletions

View File

@ -194,9 +194,15 @@ void _PyObject_Dump(PyObject* op)
if (op == NULL)
fprintf(stderr, "NULL\n");
else {
fprintf(stderr, "object : ");
(void)PyObject_Print(op, stderr, 0);
fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
fprintf(stderr, "address : %p\n", op);
fprintf(stderr, "\n"
"type : %s\n"
"refcount: %d\n"
"address : %p\n",
op->ob_type==NULL ? "NULL" : op->ob_type->tp_name,
op->ob_refcnt,
op);
}
}