Author: pmichaud Date: Mon Nov 24 14:40:57 2008 New Revision: 33159 Modified: branches/lex5/src/gc/register.c
Log: Report the subname of whatever we're referencing for easier tracing. Modified: branches/lex5/src/gc/register.c ============================================================================== --- branches/lex5/src/gc/register.c (original) +++ branches/lex5/src/gc/register.c Mon Nov 24 14:40:57 2008 @@ -639,8 +639,11 @@ ARGIN(const char *file), int line) { if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) { - fprintf(stderr, "[reference to context %p taken at %s:%d]\n", - (void *)ctx, file, line); + char *name = "unknown"; + if (ctx->current_sub) + name = (char *)(PMC_sub(ctx->current_sub)->name->strstart); + fprintf(stderr, "[reference to context %p ('%s') taken at %s:%d]\n", + (void *)ctx, name, file, line); } ctx->ref_count++; return ctx;